summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-05-06 21:21:06 (GMT)
committerGitHub <noreply@github.com>2024-05-06 21:21:06 (GMT)
commit616b745b89a52a1d27123107718f85e65918afdc (patch)
tree3e0c5691ed679c3d0008f87da0e8661077934a6e /Objects
parent00d913c6718aa365027c6dcf850e8f40731e54fc (diff)
downloadcpython-616b745b89a52a1d27123107718f85e65918afdc.zip
cpython-616b745b89a52a1d27123107718f85e65918afdc.tar.gz
cpython-616b745b89a52a1d27123107718f85e65918afdc.tar.bz2
GH-115709: Invalidate executors when a local variable is changed via frame.f_locals (#118639)
Also fix unrelated assert in debug Tier2/JIT builds.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/frameobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/frameobject.c b/Objects/frameobject.c
index 869cdec..26a04cb 100644
--- a/Objects/frameobject.c
+++ b/Objects/frameobject.c
@@ -148,8 +148,9 @@ framelocalsproxy_setitem(PyObject *self, PyObject *key, PyObject *value)
if (PyUnicode_CheckExact(key)) {
int i = framelocalsproxy_getkeyindex(frame, key, false);
if (i >= 0) {
- _PyLocals_Kind kind = _PyLocals_GetKind(co->co_localspluskinds, i);
+ _Py_Executors_InvalidateDependency(PyInterpreterState_Get(), co, 1);
+ _PyLocals_Kind kind = _PyLocals_GetKind(co->co_localspluskinds, i);
PyObject *oldvalue = fast[i];
PyObject *cell = NULL;
if (kind == CO_FAST_FREE) {