[Python-checkins] python/dist/src/Python ceval.c,2.301.4.2,2.301.4.3

gvanrossum@users.sourceforge.net gvanrossum@users.sourceforge.net
Tue, 11 Jun 2002 20:48:48 -0700


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

Modified Files:
      Tag: release22-maint
	ceval.c 
Log Message:
Backport:

SF bug 567538: Generator can crash the interpreter (Finn Bock).

This was a simple typo.  Strange that the compiler didn't catch it!
Instead of WHY_CONTINUE, two tests used CONTINUE_LOOP, which isn't a
why_code at all, but an opcode; but even though 'why' is declared as
an enum, comparing it to an int is apparently not even worth a
warning -- not in gcc, and not in VC++. :-(


Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.301.4.2
retrieving revision 2.301.4.3
diff -C2 -d -r2.301.4.2 -r2.301.4.3
*** ceval.c	28 Mar 2002 20:18:48 -0000	2.301.4.2
--- ceval.c	12 Jun 2002 03:48:46 -0000	2.301.4.3
***************
*** 1498,1502 ****
  				if (why == WHY_RETURN ||
  				    why == WHY_YIELD ||
! 				    why == CONTINUE_LOOP)
  					retval = POP();
  			}
--- 1498,1502 ----
  				if (why == WHY_RETURN ||
  				    why == WHY_YIELD ||
! 				    why == WHY_CONTINUE)
  					retval = POP();
  			}
***************
*** 2294,2298 ****
  				else {
  					if (why == WHY_RETURN ||
! 					    why == CONTINUE_LOOP)
  						PUSH(retval);
  					v = PyInt_FromLong((long)why);
--- 2294,2298 ----
  				else {
  					if (why == WHY_RETURN ||
! 					    why == WHY_CONTINUE)
  						PUSH(retval);
  					v = PyInt_FromLong((long)why);