Skip to content

Commit 087b9ee

Browse files
committed
Use current instruction for f_lineno addr2line
lasti is stored as the next instruction index. addr2line of that byte offset is past RETURN_VALUE, so f_lineno was None and stdlib_threading_current_frames hung on leftover workers. Assisted-by: Grok:grok-4.6
1 parent 3678efd commit 087b9ee

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

crates/vm/src/builtins/frame.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,9 @@ impl FrameObject {
525525
return prev as i32;
526526
}
527527
}
528-
self.f_code().addr2line(lasti_bytes)
528+
// lasti is stored as the next instruction index (see FrameObject::run),
529+
// so the executing opcode is at lasti-1 / lasti_bytes-2.
530+
self.f_code().addr2line(lasti_bytes - 2)
529531
}
530532

531533
#[pygetset(name = "f_lineno")]

0 commit comments

Comments
 (0)