Skip to content
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

Make tracing info (bounds, and previous instruction offset) a bit more robust #24726

Merged
merged 1 commit into from Mar 5, 2021

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Mar 3, 2021

Small refactoring to the handling of tracing in _PyEval_EvalFrameDefault.
This is strictly a refactoring; it does not change behavior in any way.

Currently we rely on instr_prev to determine if bounds is up to date. If instr_prev < 0 then bounds is not up to date.
This is undocumented, and thus fragile.
In addition, we have to initialize bounds every time, even if we never need it.

This PR bundles instr_prev and bounds, along with a pointer to the code object into a new struct.
Passing this trace_info around instead of the bounds means that we never pass an inconsistent data structure around.

@markshannon markshannon merged commit 8e1b406 into python:master Mar 5, 2021
10 checks passed
kreathon pushed a commit to kreathon/cpython that referenced this pull request May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants