8000 gh-106812: Fix two tiny bugs in analysis.py (#107649) · python/cpython@0255bf2 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0255bf2

Browse files
gvanrossumpull[bot]
authored andcommitted
gh-106812: Fix two tiny bugs in analysis.py (#107649)
This fixes two tiny defects in analysis.py that I didn't catch on time in #107564: - `get_var_names` in `check_macro_consistency` should skip `UNUSED` names. - Fix an occurrence of `is UNUSED` (should be `==`).
1 parent 40125dd commit 0255bf2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Tools/cases_generator/analysis.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,8 @@ def check_macro_consistency(self, mac: MacroInstruction) -> None:
297297
def get_var_names(instr: Instruction) -> dict[str, StackEffect]:
298298
vars: dict[str, StackEffect] = {}
299299
for eff in instr.input_effects + instr.output_effects:
300+
if eff.name == UNUSED:
301+
continue
300302
if eff.name in vars:
301303
if vars[eff.name] != eff:
302304
self.error(
@@ -335,7 +337,7 @@ def get_var_names(instr: Instruction) -> dict[str, StackEffect]:
335337
copies: list[tuple[StackEffect, StackEffect]] = []
336338
while pushes and pops and pushes[-1] == pops[0]:
337339
src, dst = pushes.pop(), pops.pop(0)
338-
if src.name == dst.name or dst.name is UNUSED:
340+
if src.name == dst.name or dst.name == UNUSED:
339341
continue
340342
copies.append((src, dst))
341343
reads = set(copy[0].name for copy in copies)

0 commit comments

Comments
 (0)
0