@@ -739,10 +739,10 @@ dummy_func(
739739 Py_XSETREF (exc_info -> exc_value , exc_value );
740740 }
741741
742- // stack effect: (__0 -- )
743- inst ( RERAISE ) {
742+ inst ( RERAISE , ( values [ oparg ], exc -- values [ oparg ])) {
743+ assert ( oparg >= 0 && oparg <= 2 );
744744 if (oparg ) {
745- PyObject * lasti = PEEK ( oparg + 1 ) ;
745+ PyObject * lasti = values [ 0 ] ;
746746 if (PyLong_Check (lasti )) {
747747 frame -> prev_instr = _PyCode_CODE (frame -> f_code ) + PyLong_AsLong (lasti );
748748 assert (!_PyErr_Occurred (tstate ));
@@ -753,11 +753,11 @@ dummy_func(
753753 goto error ;
754754 }
755755 }
756- PyObject * val = POP ( );
757- assert ( val && PyExceptionInstance_Check ( val ) );
758- PyObject * exc = Py_NewRef (PyExceptionInstance_Class (val ));
759- PyObject * tb = PyException_GetTraceback (val );
760- _PyErr_Restore (tstate , exc , val , tb );
756+ assert ( exc && PyExceptionInstance_Check ( exc ) );
757+ Py_INCREF ( exc );
758+ PyObject * typ = Py_NewRef (PyExceptionInstance_Class (exc ));
759+ PyObject * tb = PyException_GetTraceback (exc );
760+ _PyErr_Restore (tstate , typ , exc , tb );
761761 goto exception_unwind ;
762762 }
763763
@@ -784,18 +784,12 @@ dummy_func(
784784 }
785785 }
786786
787- // stack effect: (__0, __1 -- )
788- inst (CLEANUP_THROW ) {
787+ inst (CLEANUP_THROW , (sub_iter , last_sent_val , exc_value -- value )) {
789788 assert (throwflag );
790- PyObject * exc_value = TOP ();
791789 assert (exc_value && PyExceptionInstance_Check (exc_value ));
792790 if (PyErr_GivenExceptionMatches (exc_value , PyExc_StopIteration )) {
793- PyObject * value = ((PyStopIterationObject * )exc_value )-> value ;
794- Py_INCREF (value );
795- Py_DECREF (POP ()); // The StopIteration.
796- Py_DECREF (POP ()); // The last sent value.
797- Py_DECREF (POP ()); // The delegated sub-iterator.
798- PUSH (value );
791+ value = Py_NewRef (((PyStopIterationObject * )exc_value )-> value );
792+ DECREF_INPUTS ();
799793 }
800794 else {
801795 PyObject * exc_type = Py_NewRef (Py_TYPE (exc_value ));
0 commit comments