diff Python/ceval.c @ 25532:ca01f4b85853 legacy-trunk

Fix for the recursion_level bug Armin Rigo reported in sf 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 ;-).
author Michael W. Hudson <mwh@python.net>
date Wed, 02 Oct 2002 13:13:45 +0000
parents 1e46da1e6522
children 5fe07cd4b2bf
line wrap: on
line diff
--- a/Python/ceval.c	Tue Oct 01 18:50:56 2002 +0000
+++ b/Python/ceval.c	Wed Oct 02 13:13:45 2002 +0000
@@ -636,6 +636,8 @@
 			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;
 			}
 		}
@@ -646,6 +648,8 @@
 				       tstate->c_profileobj,
 				       f, PyTrace_CALL, Py_None)) {
 				/* Profile function raised an error */
+				--tstate->recursion_depth;
+				tstate->frame = f->f_back;
 				return NULL;
 			}
 		}