mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
[3.12] gh-130809: Fix PyFrame_LocalsToFast
copying the wrong value (#130816)
* gh-130809: Fix `PyFrame_LocalsToFast` copying the wrong value * Skip hidden locals * test, blurb * Update Misc/NEWS.d/next/Core_and_Builtins/2025-03-04-12-52-21.gh-issue-130809.fSXq60.rst Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com> * Update test * PR feedback * formatting * comment --------- Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
This commit is contained in:
parent
fcf1f57d91
commit
33605da91c
3 changed files with 22 additions and 0 deletions
|
@ -1405,6 +1405,9 @@ _PyFrame_LocalsToFast(_PyInterpreterFrame *frame, int clear)
|
|||
if (kind & CO_FAST_FREE && !(co->co_flags & CO_OPTIMIZED)) {
|
||||
continue;
|
||||
}
|
||||
if (kind & CO_FAST_HIDDEN) {
|
||||
continue;
|
||||
}
|
||||
PyObject *name = PyTuple_GET_ITEM(co->co_localsplusnames, i);
|
||||
PyObject *value = PyObject_GetItem(locals, name);
|
||||
/* We only care about NULLs if clear is true. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue