From: Jeremy Hylton Date: Wed, 17 Oct 2001 13:29:30 +0000 (+0000) Subject: For debug build, check that the stack pointer never exceeds the stack size. X-Git-Tag: v2.2.1c1~1222 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14368158c2f7b646a170c0e31cdf115c0947a697;p=thirdparty%2FPython%2Fcpython.git For debug build, check that the stack pointer never exceeds the stack size. --- diff --git a/Python/ceval.c b/Python/ceval.c index ef995948fb8e..b0371aa44718 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -542,7 +542,9 @@ eval_frame(PyFrameObject *f) #define BASIC_POP() (*--stack_pointer) #ifdef LLTRACE -#define PUSH(v) (void)(BASIC_PUSH(v), lltrace && prtrace(TOP(), "push")) +#define PUSH(v) { (void)(BASIC_PUSH(v), \ + lltrace && prtrace(TOP(), "push")); \ + assert(STACK_LEVEL() <= f->f_stacksize); } #define POP() ((void)(lltrace && prtrace(TOP(), "pop")), BASIC_POP()) #else #define PUSH(v) BASIC_PUSH(v)