[Stackless-checkins] r51096 - stackless/trunk/Python/ceval.c
richard.tew
python-checkins at python.org
Fri Aug 4 16:03:34 CEST 2006
Author: richard.tew
Date: Fri Aug 4 16:03:29 2006
New Revision: 51096
Modified:
stackless/trunk/Python/ceval.c
Log:
Fix for an obscure Stackless bug (possibly present in 2.4.3). If any of the CALL_FUNCTION opcodes invoked something which soft switched and also changed the thread state frame value from the current frame, then if the frames f_execute variable was PyEval_EvalFrame_noval, the return value from the function call would not be on the stack (and therefore the stack would be corrupt) when the frame was invoked again.
Modified: stackless/trunk/Python/ceval.c
==============================================================================
--- stackless/trunk/Python/ceval.c (original)
+++ stackless/trunk/Python/ceval.c Fri Aug 4 16:03:29 2006
@@ -2847,8 +2847,11 @@
return retval;
STACKLESS_UNPACK(retval);
retval = tstate->frame->f_execute(tstate->frame, 0, retval);
- if (tstate->frame != f)
+ if (tstate->frame != f) {
+ assert(f->f_execute == PyEval_EvalFrame_value || f->f_execute == PyEval_EvalFrame_noval);
+ f->f_execute = PyEval_EvalFrame_value;
return retval;
+ }
if (STACKLESS_UNWINDING(retval))
STACKLESS_UNPACK(retval);
_______________________________________________
Stackless-checkins mailing list
Stackless-checkins at stackless.com
http://www.stackless.com/mailman/listinfo/stackless-checkins
More information about the Stackless-checkins
mailing list