[Python-checkins] python/dist/src/Python ceval.c,2.329,2.330

mwh@users.sourceforge.net mwh@users.sourceforge.net
Tue, 20 Aug 2002 08:19:17 -0700


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv3102

Modified Files:
	ceval.c 
Log Message:
My patch #597221.  Use f_lasti more consistently.


Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.329
retrieving revision 2.330
diff -C2 -d -r2.329 -r2.330
*** ceval.c	19 Aug 2002 21:17:53 -0000	2.329
--- ceval.c	20 Aug 2002 15:19:14 -0000	2.330
***************
*** 600,609 ****
  	freevars = f->f_localsplus + f->f_nlocals;
  	_PyCode_GETCODEPTR(co, &first_instr);
! 	if (f->f_lasti < 0) {
! 		next_instr = first_instr;
! 	}
! 	else {
! 		next_instr = first_instr + f->f_lasti;
! 	}
  	stack_pointer = f->f_stacktop;
  	assert(stack_pointer != NULL);
--- 600,612 ----
  	freevars = f->f_localsplus + f->f_nlocals;
  	_PyCode_GETCODEPTR(co, &first_instr);
! 	/* An explanation is in order for the next line.
! 
! 	   f->f_lasti now refers to the index of the last instruction
! 	   executed.  You might think this was obvious from the name, but
! 	   this wasn't always true before 2.3!  PyFrame_New now sets
! 	   f->f_lasti to -1 (i.e. the index *before* the first instruction
! 	   and YIELD_VALUE doesn't fiddle with f_lasti any more.  So this
! 	   does work.  Promise. */
! 	next_instr = first_instr + f->f_lasti + 1;
  	stack_pointer = f->f_stacktop;
  	assert(stack_pointer != NULL);
***************
*** 1522,1528 ****
  			retval = POP();
  			f->f_stacktop = stack_pointer;
- 			/* abuse the lasti field: here it points to 
- 			   the *next* instruction */
- 			f->f_lasti = INSTR_OFFSET();
  			why = WHY_YIELD;
  			break;
--- 1525,1528 ----