]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix for the recursion_level bug Armin Rigo reported in sf
authorMichael W. Hudson <mwh@python.net>
Wed, 2 Oct 2002 13:13:45 +0000 (13:13 +0000)
committerMichael W. Hudson <mwh@python.net>
Wed, 2 Oct 2002 13:13:45 +0000 (13:13 +0000)
patch #617312, both on the trunk and the 22-maint branch.

Also added a test case, and ported the test_trace I wrote for HEAD
to 2.2.2 (with all those horrible extra 'line' events ;-).

Python/ceval.c

index 57922598e2634da7d08b813d81d5a24d2eb59a56..9db5b023afdfd697f463f98ed29ec71f3d9af65e 100644 (file)
@@ -612,6 +612,8 @@ eval_frame(PyFrameObject *f)
                        if (call_trace(tstate->c_tracefunc, tstate->c_traceobj,
                                       f, PyTrace_CALL, Py_None)) {
                                /* Trace function raised an error */
+                               --tstate->recursion_depth;
+                               tstate->frame = f->f_back;
                                return NULL;
                        }
                }
@@ -622,6 +624,8 @@ eval_frame(PyFrameObject *f)
                                       tstate->c_profileobj,
                                       f, PyTrace_CALL, Py_None)) {
                                /* Profile function raised an error */
+                               --tstate->recursion_depth;
+                               tstate->frame = f->f_back;
                                return NULL;
                        }
                }