[Python-checkins] r73611 - python/branches/py3k/Python/ceval.c

benjamin.peterson python-checkins at python.org
Sun Jun 28 17:40:51 CEST 2009


Author: benjamin.peterson
Date: Sun Jun 28 17:40:50 2009
New Revision: 73611

Log:
correctly rearrange the stack in the exception case of WITH_CLEANUP

Modified:
   python/branches/py3k/Python/ceval.c

Modified: python/branches/py3k/Python/ceval.c
==============================================================================
--- python/branches/py3k/Python/ceval.c	(original)
+++ python/branches/py3k/Python/ceval.c	Sun Jun 28 17:40:50 2009
@@ -2533,10 +2533,21 @@
 				u = v = w = Py_None;
 			}
 			else {
+				PyObject *tp, *exc, *tb;
+				PyTryBlock *block;
 			        v = SECOND();
 				w = THIRD();
+				tp = FOURTH();
+				exc = stack_pointer[-5];
+				tb = stack_pointer[-6];
 				exit_func = stack_pointer[-7];
-				stack_pointer[-7] = NULL;
+				stack_pointer[-7] = tb;
+				stack_pointer[-6] = exc;
+				stack_pointer[-5] = tp;
+				FOURTH() = NULL;
+				block = &f->f_blockstack[f->f_iblock - 1];
+				assert(block->b_type == EXCEPT_HANDLER);
+				block->b_level--;
 			}
 			/* XXX Not the fastest way to call it... */
 			x = PyObject_CallFunctionObjArgs(exit_func, u, v, w,


More information about the Python-checkins mailing list