Bug report
Bug description:
_GUARD_CODE_VERSION checks that the code object has the expected version and exits the trace if it doesn't.
However, it exits to the current instruction pointer frame->instr_ptr which can be the wrong location.
After a return it should exit to frame->instr_ptr + frame->return_offset, after a yield it should return to \frame->instr_ptr + 1 + INLINE_CACHE_ENTRIES_SEND. It is only after a call that it should return to frame->instr_ptr`.
We already handle these three cases for IP guards: _GUARD_IP__PUSH_FRAME, _GUARD_IP_RETURN, _GUARD_IP_YIELD_VALUE, so all we need to do is duplicate that logic for _GUARD_CODE_VERSION
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
Bug report
Bug description:
_GUARD_CODE_VERSIONchecks that the code object has the expected version and exits the trace if it doesn't.However, it exits to the current instruction pointer
frame->instr_ptrwhich can be the wrong location.After a return it should exit to
frame->instr_ptr + frame->return_offset, after ayieldit should return to \frame->instr_ptr + 1 + INLINE_CACHE_ENTRIES_SEND. It is only after a call that it should return toframe->instr_ptr`.We already handle these three cases for IP guards:
_GUARD_IP__PUSH_FRAME,_GUARD_IP_RETURN,_GUARD_IP_YIELD_VALUE, so all we need to do is duplicate that logic for_GUARD_CODE_VERSIONCPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs