summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2021-06-07 18:22:26 (GMT)
committerGitHub <noreply@github.com>2021-06-07 18:22:26 (GMT)
commit2ab27c4af4ddf7528e1375e77c787c7fbb09b5e6 (patch)
treed3983e5282f575560cb7449fae4785447fdfff14 /Tools
parent001eb520b5757294dc455c900d94b7b153de6cdd (diff)
downloadcpython-2ab27c4af4ddf7528e1375e77c787c7fbb09b5e6.zip
cpython-2ab27c4af4ddf7528e1375e77c787c7fbb09b5e6.tar.gz
cpython-2ab27c4af4ddf7528e1375e77c787c7fbb09b5e6.tar.bz2
bpo-43693: Un-revert commits 2c1e258 and b2bf2bc. (gh-26577)
These were reverted in gh-26530 (commit 17c4edc) due to refleaks. * 2c1e258 - Compute deref offsets in compiler (gh-25152) * b2bf2bc - Add new internal code objects fields: co_fastlocalnames and co_fastlocalkinds. (gh-26388) This change fixes the refleaks. https://bugs.python.org/issue43693
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/gdb/libpython.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Tools/gdb/libpython.py b/Tools/gdb/libpython.py
index c1d2cd8..756b52c 100755
--- a/Tools/gdb/libpython.py
+++ b/Tools/gdb/libpython.py
@@ -871,7 +871,8 @@ class PyFrameObjectPtr(PyObjectPtr):
self.f_lineno = int_from_int(self.field('f_lineno'))
self.f_lasti = int_from_int(self.field('f_lasti'))
self.co_nlocals = int_from_int(self.co.field('co_nlocals'))
- self.co_varnames = PyTupleObjectPtr.from_pyobject_ptr(self.co.field('co_varnames'))
+ pnames = self.co.field('co_localsplusnames')
+ self.co_localsplusnames = PyTupleObjectPtr.from_pyobject_ptr(pnames)
def iter_locals(self):
'''
@@ -884,9 +885,10 @@ class PyFrameObjectPtr(PyObjectPtr):
f_localsplus = self.field('f_localsptr')
for i in safe_range(self.co_nlocals):
pyop_value = PyObjectPtr.from_pyobject_ptr(f_localsplus[i])
- if not pyop_value.is_null():
- pyop_name = PyObjectPtr.from_pyobject_ptr(self.co_varnames[i])
- yield (pyop_name, pyop_value)
+ if pyop_value.is_null():
+ continue
+ pyop_name = PyObjectPtr.from_pyobject_ptr(self.co_localsplusnames[i])
+ yield (pyop_name, pyop_value)
def _f_globals(self):
f_localsplus = self.field('f_localsptr')