[Python-checkins] CVS: python/dist/src/Objects frameobject.c,2.49,2.50

Jeremy Hylton jhylton@users.sourceforge.net
2001年5月07日 21:08:22 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv22044
Modified Files:
	frameobject.c 
Log Message:
SF patch 419176 from MvL; fixed bug 418977
Two errors in dict_to_map() helper used by PyFrame_LocalsToFast().
Index: frameobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/frameobject.c,v
retrieving revision 2.49
retrieving revision 2.50
diff -C2 -r2.49 -r2.50
*** frameobject.c	2001年04月14日 17:55:41	2.49
--- frameobject.c	2001年05月08日 04:08:20	2.50
***************
*** 284,293 ****
 		Py_XINCREF(value);
 		if (deref) {
! 			if (value) {
 				if (PyCell_Set(values[j], value) < 0)
 					PyErr_Clear();
- 			} else if (clear) {
- 				Py_XDECREF(values[j]);
- 				values[j] = value;
 			}
 		} else if (value != NULL || clear) {
--- 284,290 ----
 		Py_XINCREF(value);
 		if (deref) {
! 			if (value || clear) {
 				if (PyCell_Set(values[j], value) < 0)
 					PyErr_Clear();
 			}
 		} else if (value != NULL || clear) {
***************
*** 371,378 ****
 		dict_to_map(f->f_code->co_cellvars, 
 			 PyTuple_GET_SIZE(f->f_code->co_cellvars),
! 			 locals, fast, 1, clear);
 		dict_to_map(f->f_code->co_freevars, 
 			 PyTuple_GET_SIZE(f->f_code->co_freevars),
! 			 locals, fast, 1, clear);
 	}
 	PyErr_Restore(error_type, error_value, error_traceback);
--- 368,375 ----
 		dict_to_map(f->f_code->co_cellvars, 
 			 PyTuple_GET_SIZE(f->f_code->co_cellvars),
! 			 locals, fast + f->f_nlocals, 1, clear);
 		dict_to_map(f->f_code->co_freevars, 
 			 PyTuple_GET_SIZE(f->f_code->co_freevars),
! 			 locals, fast + f->f_nlocals + f->f_ncells, 1, clear);
 	}
 	PyErr_Restore(error_type, error_value, error_traceback);

AltStyle によって変換されたページ (->オリジナル) /