]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
For debug build, check that the stack pointer never exceeds the stack size.
authorJeremy Hylton <jeremy@alum.mit.edu>
Wed, 17 Oct 2001 13:29:30 +0000 (13:29 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Wed, 17 Oct 2001 13:29:30 +0000 (13:29 +0000)
Python/ceval.c

index ef995948fb8e2891cdf6da153d1adabcfe599fd7..b0371aa447186a22e9c1765995bc2d69f16af4a6 100644 (file)
@@ -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)