From a94461d7189d7f1147ab304a332c8684263dc17e Mon Sep 17 00:00:00 2001 From: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Date: Tue, 4 Jan 2022 10:37:12 +0000 Subject: bpo-46202: Remove opcode POP_EXCEPT_AND_RERAISE (GH-30302) * bpo-46202: remove opcode POP_EXCEPT_AND_RERAISE * do not assume that an exception group is truthy --- Python/ceval.c | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'Python/ceval.c') diff --git a/Python/ceval.c b/Python/ceval.c index 43925e6db2..81bea44465 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2725,31 +2725,6 @@ check_eval_breaker: DISPATCH(); } - TARGET(POP_EXCEPT_AND_RERAISE) { - PyObject *lasti = PEEK(2); - if (PyLong_Check(lasti)) { - frame->f_lasti = PyLong_AsLong(lasti); - assert(!_PyErr_Occurred(tstate)); - } - else { - _PyErr_SetString(tstate, PyExc_SystemError, "lasti is not an int"); - goto error; - } - PyObject *value = POP(); - assert(value); - assert(PyExceptionInstance_Check(value)); - PyObject *type = Py_NewRef(PyExceptionInstance_Class(value)); - PyObject *traceback = PyException_GetTraceback(value); - Py_DECREF(POP()); /* lasti */ - _PyErr_Restore(tstate, type, value, traceback); - - _PyErr_StackItem *exc_info = tstate->exc_info; - value = exc_info->exc_value; - exc_info->exc_value = POP(); - Py_XDECREF(value); - goto exception_unwind; - } - TARGET(RERAISE) { if (oparg) { PyObject *lasti = PEEK(oparg + 1); -- cgit v1.2.1