cpp: check buffer stack instead of cppeval variable