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

gh-98398: Fix source locations for 'assert' bytecode #98405

Merged
merged 3 commits into from Oct 19, 2022

Conversation

iritkatriel
Copy link
Member

@iritkatriel iritkatriel commented Oct 18, 2022

@iritkatriel iritkatriel added type-bug An unexpected behavior, bug, or error interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.12 labels Oct 18, 2022
@iritkatriel iritkatriel requested a review from brandtbucher Oct 18, 2022
@iritkatriel iritkatriel requested a review from markshannon as a code owner Oct 18, 2022
Copy link
Member

@brandtbucher brandtbucher left a comment

Looks fine, but is there a reason why multiple LOC(s) are preferred to using loc like before? It seems to me that it would just be easier to "fix" all of these sites at once by not using a pointer for ploc in compiler_jump_if. I don't think it's ever correct, right? (And I've already mentioned that updating ploc in compiler_jump_if is an open bug.)

But maybe I'm missing something?

@iritkatriel
Copy link
Member Author

iritkatriel commented Oct 18, 2022

On LOC(s) vs loc - I think it's nice to have the explicit location for each instruction. No?

Re the bug in compiler_jump_if - I might as well try to add the tests we are missing before I fix it.

@markshannon
Copy link
Member

markshannon commented Oct 19, 2022

Regarding LOC(s); LOC(s); LOC(s) or loc = LOC(s); loc; loc; loc, I don't think it really matters.
I prefer the LOC(s) form, as I can see what location is being passed without having to look for the definition of loc.

@iritkatriel iritkatriel merged commit 9be05df into python:main Oct 19, 2022
15 checks passed
@iritkatriel iritkatriel deleted the assert_lineno branch Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants