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-91409: Don't overwrite valid locations with NOP locations #95067

Merged
merged 3 commits into from Jul 20, 2022

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Jul 20, 2022

If a NOP is followed by a "real" instruction with the same line number, don't overwrite the instruction's location with the NOP's location. That only makes sense if the instruction has no location at all.

@brandtbucher brandtbucher added type-bug An unexpected behavior, bug, or error interpreter-core (Objects, Python, Grammar, and Parser dirs) needs backport to 3.11 labels Jul 20, 2022
@brandtbucher brandtbucher requested a review from iritkatriel Jul 20, 2022
@brandtbucher brandtbucher requested a review from markshannon as a code owner Jul 20, 2022
@brandtbucher brandtbucher self-assigned this Jul 20, 2022
@brandtbucher brandtbucher merged commit 742d461 into python:main Jul 20, 2022
14 checks passed
@miss-islington
Copy link
Contributor

miss-islington commented Jul 20, 2022

Thanks @brandtbucher for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒🤖

@miss-islington
Copy link
Contributor

miss-islington commented Jul 20, 2022

Sorry, @brandtbucher, I could not cleanly backport this to 3.11 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 742d4614e1a645d765dbf76c19bd9a818239b1cb 3.11

brandtbucher added a commit to brandtbucher/cpython that referenced this pull request Jul 20, 2022
…ions (pythonGH-95067).

(cherry picked from commit 742d461)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
@bedevere-bot
Copy link

bedevere-bot commented Jul 20, 2022

GH-95068 is a backport of this pull request to the 3.11 branch.

brandtbucher added a commit that referenced this pull request Jul 20, 2022
@brandtbucher brandtbucher deleted the nop-locs branch Jul 21, 2022
@tirkarthi
Copy link
Member

tirkarthi commented Aug 23, 2022

The test seems to introduce a syntax warning while compiling below code in subtest

import abc, dis
import ast as art

abc = None
dix = dis
ast = art

def f():
   [dis]() # syntax warning on this line
./python -Wall -m test test_compile -m test_push_null_load_global_positions
0:00:00 load avg: 1.39 Run tests sequentially
0:00:00 load avg: 1.39 [1/1] test_compile
<string>:10: SyntaxWarning: 'list' object is not callable; perhaps you missed a comma?

== Tests result: SUCCESS ==

1 test OK.

Total duration: 95 ms
Tests result: SUCCESS

@iritkatriel
Copy link
Member

iritkatriel commented Aug 25, 2022

@tirkarthi Thank, I've created #96277.

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) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants