Skip to content

gh-109094: remove unnecessary updates of frame->prev_instr in instrumentation functions #109076

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 7, 2023

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Sep 7, 2023

There are updates to frame->prev_instr which are either redundant (in _Py_call_instrumentation_line) or don't seem to serve any purpose (_Py_call_instrumentation_jump). Removing them does not impact anything we can see through our tests.

This PR removes them and adds assertions that the line implied by f_lasti is the same as f_lineno in line and jump event callbacks.

@iritkatriel iritkatriel changed the title assert lineno and lasti agree. Remove prev_instr setting in _Py_call_… gh-109094: remove unnecessary updates of frame->prev_instr in instrumentation functions Sep 7, 2023
@iritkatriel iritkatriel marked this pull request as ready for review September 7, 2023 16:16
@iritkatriel iritkatriel added skip news interpreter-core (Objects, Python, Grammar, and Parser dirs) and removed awaiting core review labels Sep 7, 2023
Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants