diff Python/ceval.c @ 25533:75e5a2a71729 2.2

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 7ca46e08200d
children 85062a12c24f
line wrap: on
line diff
--- a/Python/ceval.c	Wed Oct 02 13:13:45 2002 +0000
+++ b/Python/ceval.c	Wed Oct 02 13:13:45 2002 +0000
@@ -612,6 +612,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;
 			}
 		}
@@ -622,6 +624,8 @@
 				       tstate->c_profileobj,
 				       f, PyTrace_CALL, Py_None)) {
 				/* Profile function raised an error */
+				--tstate->recursion_depth;
+				tstate->frame = f->f_back;
 				return NULL;
 			}
 		}