From: Michael W. Hudson Date: Mon, 7 Oct 2002 09:37:26 +0000 (+0000) Subject: This is Armin Rigo's patch: X-Git-Tag: v2.2.2b1~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b397f21432b617f25875db0157c3b90b6b7b3977;p=thirdparty%2FPython%2Fcpython.git This is Armin Rigo's patch: [ 617312 ] debugger-controlled jumps (Psyco #3) Forward port candidate, I guess. --- diff --git a/Python/ceval.c b/Python/ceval.c index 9db5b023afdf..e8fefca8a8cc 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -585,14 +585,6 @@ eval_frame(PyFrameObject *f) } tstate->frame = f; - co = f->f_code; - fastlocals = f->f_localsplus; - freevars = f->f_localsplus + f->f_nlocals; - _PyCode_GETCODEPTR(co, &first_instr); - next_instr = first_instr + f->f_lasti; - stack_pointer = f->f_stacktop; - assert(stack_pointer != NULL); - f->f_stacktop = NULL; /* remains NULL unless yield suspends frame */ if (tstate->use_tracing) { if (tstate->c_tracefunc != NULL) { @@ -631,6 +623,15 @@ eval_frame(PyFrameObject *f) } } + co = f->f_code; + fastlocals = f->f_localsplus; + freevars = f->f_localsplus + f->f_nlocals; + _PyCode_GETCODEPTR(co, &first_instr); + next_instr = first_instr + f->f_lasti; + stack_pointer = f->f_stacktop; + assert(stack_pointer != NULL); + f->f_stacktop = NULL; /* remains NULL unless yield suspends frame */ + #ifdef LLTRACE lltrace = PyDict_GetItemString(f->f_globals,"__lltrace__") != NULL; #endif @@ -1972,6 +1973,7 @@ eval_frame(PyFrameObject *f) continue; /* Trace each line of code reached */ f->f_lasti = INSTR_OFFSET(); + f->f_stacktop = stack_pointer; /* Inline call_trace() for performance: */ tstate->tracing++; tstate->use_tracing = 0; @@ -1980,6 +1982,11 @@ eval_frame(PyFrameObject *f) tstate->use_tracing = (tstate->c_tracefunc || tstate->c_profilefunc); tstate->tracing--; + /* Reload possibly changed frame fields */ + JUMPTO(f->f_lasti); + stack_pointer = f->f_stacktop; + assert(stack_pointer != NULL); + f->f_stacktop = NULL; break; case CALL_FUNCTION: