[Python-checkins] CVS: python/dist/src/Python ceval.c,2.254,2.255

Tim Peters tim_one@users.sourceforge.net
Fri, 22 Jun 2001 22:47:58 -0700


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

Modified Files:
	ceval.c 
Log Message:
gen_iternext():  Don't assume that the current thread state's frame is
not NULL.  I don't think it can be NULL from Python code, but if using
generators via the C API I expect a NULL frame is possible.


Index: ceval.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v
retrieving revision 2.254
retrieving revision 2.255
diff -C2 -r2.254 -r2.255
*** ceval.c	2001/06/23 05:26:56	2.254
--- ceval.c	2001/06/23 05:47:56	2.255
***************
*** 153,157 ****
  	/* Generators always return to their most recent caller, not
  	 * necessarily their creator. */
! 	Py_INCREF(tstate->frame);
  	assert(f->f_back == NULL);
  	f->f_back = tstate->frame;
--- 153,157 ----
  	/* Generators always return to their most recent caller, not
  	 * necessarily their creator. */
! 	Py_XINCREF(tstate->frame);
  	assert(f->f_back == NULL);
  	f->f_back = tstate->frame;
***************
*** 164,168 ****
  	 * may keep a chain of frames alive or it could create a reference
  	 * cycle. */
! 	Py_DECREF(f->f_back);
  	f->f_back = NULL;
  
--- 164,168 ----
  	 * may keep a chain of frames alive or it could create a reference
  	 * cycle. */
! 	Py_XDECREF(f->f_back);
  	f->f_back = NULL;