diff options
author | Mark Shannon <mark@hotpy.org> | 2024-05-06 21:21:06 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-06 21:21:06 (GMT) |
commit | 616b745b89a52a1d27123107718f85e65918afdc (patch) | |
tree | 3e0c5691ed679c3d0008f87da0e8661077934a6e /Objects | |
parent | 00d913c6718aa365027c6dcf850e8f40731e54fc (diff) | |
download | cpython-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.c | 3 |
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) { |