diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2022-01-04 10:37:12 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-04 10:37:12 (GMT) |
commit | a94461d7189d7f1147ab304a332c8684263dc17e (patch) | |
tree | bda2df4f74cc58205d548dce76337260984962fd /Python/ceval.c | |
parent | a09062c267a94200ad299f779429fea1b571ee35 (diff) | |
download | cpython-a94461d7189d7f1147ab304a332c8684263dc17e.zip cpython-a94461d7189d7f1147ab304a332c8684263dc17e.tar.gz cpython-a94461d7189d7f1147ab304a332c8684263dc17e.tar.bz2 |
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
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 43925e6..81bea44 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); |