Skip to content

Commit

Permalink
Merge pull request #178 from P403n1x87/refactor/311-lasti
Browse files Browse the repository at this point in the history
refactor: use proper lasti formula for 3.11
  • Loading branch information
P403n1x87 authored Jun 4, 2023
2 parents fbec16f + 0b864e7 commit 0484829
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ _frame_from_code_raddr(py_proc_t * py_proc, void * code_raddr, int lasti, python
return NULL;
}

lasti >>= 1;

for (size_t i = 0, bc = 0; i < len; i++) {
bc += (lnotab[i] & 7) + 1;
int code = (lnotab[i] >> 3) & 15;
Expand Down
2 changes: 1 addition & 1 deletion src/py_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ _py_thread__push_iframe_from_addr(py_thread_t * self, PyInterpreterFrame * ifram
stack_py_push(
origin,
code_raddr,
((int)(V_FIELD_PTR(void *, iframe, py_iframe, o_prev_instr) - code_raddr)) - py_v->py_code.o_code
(((int)(V_FIELD_PTR(void *, iframe, py_iframe, o_prev_instr) - code_raddr)) - py_v->py_code.o_code) / sizeof(_Py_CODEUNIT)
);

#ifdef NATIVE
Expand Down

0 comments on commit 0484829

Please sign in to comment.