aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/executor_cases.c.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-08-06 14:14:52 +0100
committerGitHub <noreply@github.com>2024-08-06 14:14:52 +0100
commit4c317918486348ff8486168e1003be8c1daa6cf5 (patch)
tree7d7dae666c53a53f9e055f8d321cd721af6a59d2 /Python/executor_cases.c.h
parent8ce70d6c697c8179e007169ba2ec5d3a0dc77362 (diff)
downloadcpython-4c317918486348ff8486168e1003be8c1daa6cf5.tar.gz
cpython-4c317918486348ff8486168e1003be8c1daa6cf5.zip
GH-120024: Move three more escaping calls out of conditional statements (GH-122734)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r--Python/executor_cases.c.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index 7f520eb7abb..afc7786c9e4 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -2085,7 +2085,12 @@
assert(PyDict_CheckExact(dict));
/* dict[key] = value */
// Do not DECREF INPUTS because the function steals the references
- if (_PyDict_SetItem_Take2((PyDictObject *)dict, PyStackRef_AsPyObjectSteal(key), PyStackRef_AsPyObjectSteal(value)) != 0) JUMP_TO_ERROR();
+ int err = _PyDict_SetItem_Take2(
+ (PyDictObject *)dict,
+ PyStackRef_AsPyObjectSteal(key),
+ PyStackRef_AsPyObjectSteal(value)
+ );
+ if (err != 0) JUMP_TO_ERROR();
stack_pointer += -2;
assert(WITHIN_STACK_BOUNDS());
break;
@@ -2895,7 +2900,8 @@
PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
assert(PyExceptionInstance_Check(left_o));
- if (_PyEval_CheckExceptTypeValid(tstate, right_o) < 0) {
+ int err = _PyEval_CheckExceptTypeValid(tstate, right_o);
+ if (err < 0) {
PyStackRef_CLOSE(right);
if (true) JUMP_TO_ERROR();
}