Skip to content

Commit d403e14

Browse files
committed
Avoid trying to read the code for shim frames
1 parent 8c7df69 commit d403e14

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/pystack/_pystack/pycode.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ getLocationInfo(
133133
tlbc_entries + sizeof(tlbc_size),
134134
tlbc_size * sizeof(uintptr_t),
135135
vec.data());
136+
LOG(DEBUG) << "tlbc_index=" << tlbc_index << " tlbc_size=" << tlbc_size;
136137
uintptr_t code_adaptive_actual = vec[tlbc_index];
137138
ptrdiff_t addrq =
138139
(reinterpret_cast<uint16_t*>(last_instruction_index)

src/pystack/_pystack/pyframe.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ FrameObject::FrameObject(
2929
if (d_is_shim) {
3030
LOG(DEBUG) << "Skipping over a shim frame inserted by the interpreter";
3131
next_frame_no = frame_no;
32+
} else {
33+
d_code = getCode(manager, frame);
3234
}
3335

34-
d_code = getCode(manager, frame);
35-
3636
auto prev_addr = frame.getField(&py_frame_v::o_back);
3737
LOG(DEBUG) << std::hex << std::showbase << "Previous frame address: " << prev_addr;
3838
if (prev_addr) {

0 commit comments

Comments
 (0)