summaryrefslogtreecommitdiffstats
path: root/Python/generated_cases.c.h
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-05-01 10:34:50 (GMT)
committerGitHub <noreply@github.com>2024-05-01 10:34:50 (GMT)
commitf6fab21721c8aedc5dca97dbeb6292a067c19bf1 (patch)
tree53f1c935bc1a956b45f826cb1302c24b285240a7 /Python/generated_cases.c.h
parent21c09d9f8195433f34b72ddfa25dd1bda3019ed7 (diff)
downloadcpython-f6fab21721c8aedc5dca97dbeb6292a067c19bf1.zip
cpython-f6fab21721c8aedc5dca97dbeb6292a067c19bf1.tar.gz
cpython-f6fab21721c8aedc5dca97dbeb6292a067c19bf1.tar.bz2
GH-118095: Make invalidating and clearing executors memory safe (GH-118459)
Diffstat (limited to 'Python/generated_cases.c.h')
-rw-r--r--Python/generated_cases.c.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 602cce4..32b485e 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -4961,9 +4961,15 @@
if ((oparg & RESUME_OPARG_LOCATION_MASK) < RESUME_AFTER_YIELD_FROM) {
CHECK_EVAL_BREAKER();
}
- #if ENABLE_SPECIALIZATION
- FT_ATOMIC_STORE_UINT8_RELAXED(this_instr->op.code, RESUME_CHECK);
- #endif /* ENABLE_SPECIALIZATION */
+ assert(this_instr->op.code == RESUME ||
+ this_instr->op.code == RESUME_CHECK ||
+ this_instr->op.code == INSTRUMENTED_RESUME ||
+ this_instr->op.code == ENTER_EXECUTOR);
+ if (this_instr->op.code == RESUME) {
+ #if ENABLE_SPECIALIZATION
+ FT_ATOMIC_STORE_UINT8_RELAXED(this_instr->op.code, RESUME_CHECK);
+ #endif /* ENABLE_SPECIALIZATION */
+ }
}
DISPATCH();
}