diff Python/ceval.c @ 28886:af53729d3cdd legacy-trunk

Armin Rigo's fix & test for [ 729622 ] line tracing hook errors with massaging from me to integrate test into test suite.
author Michael W. Hudson <mwh@python.net>
date Tue, 29 Apr 2003 16:18:47 +0000
parents 3df0cf16defc
children f9495815c18f
line wrap: on
line diff
--- a/Python/ceval.c	Tue Apr 29 14:53:08 2003 +0000
+++ b/Python/ceval.c	Tue Apr 29 16:18:47 2003 +0000
@@ -819,18 +819,19 @@
 			   for expository comments */
 			f->f_stacktop = stack_pointer;
 			
-			if (maybe_call_line_trace(tstate->c_tracefunc,
-						  tstate->c_traceobj,
-						  f, &instr_lb, &instr_ub)) {
+			err = maybe_call_line_trace(tstate->c_tracefunc,
+						    tstate->c_traceobj,
+						    f, &instr_lb, &instr_ub);
+			/* Reload possibly changed frame fields */
+			JUMPTO(f->f_lasti);
+			if (f->f_stacktop != NULL) {
+				stack_pointer = f->f_stacktop;
+				f->f_stacktop = NULL;
+			}
+			if (err) {
 				/* trace function raised an exception */
-				why = WHY_EXCEPTION;
 				goto on_error;
 			}
-			/* Reload possibly changed frame fields */
-			JUMPTO(f->f_lasti);
-			stack_pointer = f->f_stacktop;
-			assert(stack_pointer != NULL);
-			f->f_stacktop = NULL;
 		}
 
 		/* Extract opcode and argument */