diff options
author | Tim Peters <tim.peters@gmail.com> | 2001-06-23 05:26:56 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2001-06-23 05:26:56 (GMT) |
commit | 8c96369513ded66146f9cf19678029615e29bcb7 (patch) | |
tree | 76bd8eda4dd36f653ce54cbef09ddc9bbf1b4a92 /Python/ceval.c | |
parent | f5eae668a81050919293453054be392cfe4f6b8d (diff) | |
download | cpython-8c96369513ded66146f9cf19678029615e29bcb7.zip cpython-8c96369513ded66146f9cf19678029615e29bcb7.tar.gz cpython-8c96369513ded66146f9cf19678029615e29bcb7.tar.bz2 |
PyFrameObject: rename f_stackbottom to f_stacktop, since it points to
the next free valuestack slot, not to the base (in America, stacks push
and pop at the top -- they mutate at the bottom in Australia <winK>).
eval_frame(): assert that f_stacktop isn't NULL upon entry.
frame_delloc(): avoid ordered pointer comparisons involving f_stacktop
when f_stacktop is NULL.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index fcb8fc3..d6b61d5 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -147,9 +147,8 @@ gen_iternext(genobject *gen) "generator already executing"); return NULL; } - if (f->f_stackbottom == NULL) { + if (f->f_stacktop == NULL) return NULL; - } /* Generators always return to their most recent caller, not * necessarily their creator. */ @@ -584,8 +583,9 @@ eval_frame(PyFrameObject *f) freevars = f->f_localsplus + f->f_nlocals; _PyCode_GETCODEPTR(co, &first_instr); next_instr = first_instr + f->f_lasti; - stack_pointer = f->f_stackbottom; - f->f_stackbottom = NULL; + stack_pointer = f->f_stacktop; + assert(stack_pointer != NULL); + f->f_stacktop = NULL; #ifdef LLTRACE lltrace = PyDict_GetItemString(f->f_globals,"__lltrace__") != NULL; @@ -1371,7 +1371,7 @@ eval_frame(PyFrameObject *f) case YIELD_VALUE: retval = POP(); - f->f_stackbottom = stack_pointer; + f->f_stacktop = stack_pointer; f->f_lasti = INSTR_OFFSET(); why = WHY_YIELD; break; |