Skip to content

Commit e74b551

Browse files
committed
Ignore the low bits of PyStackRef when reading locals
1 parent 025f686 commit e74b551

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/pystack/_pystack/pyframe.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ FrameObject::resolveLocalVariables()
134134
return;
135135
}
136136

137+
if (d_manager->versionIsAtLeast(3, 14)) {
138+
// In Python 3.14, the local variable is a PyStackRef: a pointer
139+
// with extra flags set in its low bits. Ignore the flags.
140+
addr = addr & (~3);
141+
}
142+
137143
std::string key = d_code->Varnames()[index];
138144

139145
LOG(DEBUG) << "Copying local variable at address " << std::hex << std::showbase << addr;

0 commit comments

Comments
 (0)