summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorBrandt Bucher <brandt@python.org>2021-10-13 22:34:11 (GMT)
committerGitHub <noreply@github.com>2021-10-13 22:34:11 (GMT)
commite71662c1ae817e728233ce93882c5b20f4c31ebc (patch)
tree55524637934db90b3211e96507a512e4bec98d17 /Python/ceval.c
parent194a9526d8ee6abbbe58ef48520ec87a7e83f327 (diff)
downloadcpython-e71662c1ae817e728233ce93882c5b20f4c31ebc.zip
cpython-e71662c1ae817e728233ce93882c5b20f4c31ebc.tar.gz
cpython-e71662c1ae817e728233ce93882c5b20f4c31ebc.tar.bz2
Ensure that instruction cases are self-contained (GH-28938)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 0af233c..aef83b9 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -1710,8 +1710,8 @@ check_eval_breaker:
DISPATCH();
}
- /* We keep LOAD_CLOSURE so that the bytecode stays more readable. */
TARGET(LOAD_CLOSURE) {
+ /* We keep LOAD_CLOSURE so that the bytecode stays more readable. */
PyObject *value = GETLOCAL(oparg);
if (value == NULL) {
goto unbound_local_error;
@@ -3858,10 +3858,10 @@ check_eval_breaker:
DISPATCH();
}
-#define CANNOT_CATCH_MSG "catching classes that do not inherit from "\
- "BaseException is not allowed"
-
TARGET(JUMP_IF_NOT_EXC_MATCH) {
+ const char *cannot_catch_msg = "catching classes that do not "
+ "inherit from BaseException is not "
+ "allowed";
PyObject *right = POP();
PyObject *left = POP();
if (PyTuple_Check(right)) {
@@ -3871,7 +3871,7 @@ check_eval_breaker:
PyObject *exc = PyTuple_GET_ITEM(right, i);
if (!PyExceptionClass_Check(exc)) {
_PyErr_SetString(tstate, PyExc_TypeError,
- CANNOT_CATCH_MSG);
+ cannot_catch_msg);
Py_DECREF(left);
Py_DECREF(right);
goto error;
@@ -3881,7 +3881,7 @@ check_eval_breaker:
else {
if (!PyExceptionClass_Check(right)) {
_PyErr_SetString(tstate, PyExc_TypeError,
- CANNOT_CATCH_MSG);
+ cannot_catch_msg);
Py_DECREF(left);
Py_DECREF(right);
goto error;