diff Python/ceval.c @ 18237:f02605b8fdc1 legacy-trunk

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.
author Tim Peters <tim.peters@gmail.com>
date Sat, 23 Jun 2001 05:26:56 +0000
parents 36e825660a24
children a1ef43a6d6e1
line wrap: on
line diff
--- a/Python/ceval.c	Sat Jun 23 05:26:52 2001 +0000
+++ b/Python/ceval.c	Sat Jun 23 05:26:56 2001 +0000
@@ -147,9 +147,8 @@
 				"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 @@
 	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 @@
 
 		case YIELD_VALUE:
 			retval = POP();
-			f->f_stackbottom = stack_pointer;
+			f->f_stacktop = stack_pointer;
 			f->f_lasti = INSTR_OFFSET();
 			why = WHY_YIELD;
 			break;