summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2022-04-05 11:06:22 (GMT)
committerGitHub <noreply@github.com>2022-04-05 11:06:22 (GMT)
commit32091df41ce6e3a71df2cf37dc74b728c0d885f2 (patch)
tree0504c15f15a9ba83d08e480cc33a801cc648681d /Python/ceval.c
parent6c6e0408a663c1f53dad403f54a18d444da39cb7 (diff)
downloadcpython-32091df41ce6e3a71df2cf37dc74b728c0d885f2.zip
cpython-32091df41ce6e3a71df2cf37dc74b728c0d885f2.tar.gz
cpython-32091df41ce6e3a71df2cf37dc74b728c0d885f2.tar.bz2
bpo-47186: Replace JUMP_IF_NOT_EG_MATCH by CHECK_EG_MATCH + jump (GH-32309)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index ce4abd5..f7e08c6 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3804,7 +3804,7 @@ handle_eval_breaker:
DISPATCH();
}
- TARGET(JUMP_IF_NOT_EG_MATCH) {
+ TARGET(CHECK_EG_MATCH) {
PyObject *match_type = POP();
if (check_except_star_type_valid(tstate, match_type) < 0) {
Py_DECREF(match_type);
@@ -3825,15 +3825,11 @@ handle_eval_breaker:
assert(rest == NULL);
goto error;
}
-
if (Py_IsNone(match)) {
- Py_DECREF(match);
+ PUSH(match);
Py_XDECREF(rest);
- /* no match - jump to target */
- JUMPTO(oparg);
}
else {
-
/* Total or partial match - update the stack from
* [val]
* to
@@ -3841,17 +3837,11 @@ handle_eval_breaker:
* (rest can be Py_None)
*/
- PyObject *exc = TOP();
-
SET_TOP(rest);
PUSH(match);
-
PyErr_SetExcInfo(NULL, Py_NewRef(match), NULL);
-
- Py_DECREF(exc);
-
+ Py_DECREF(exc_value);
}
-
DISPATCH();
}