Skip to content

Commit 85e5b1f

Browse files
authored
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 4e6fac7 commit 85e5b1f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Tools/cases_generator/analysis.py

+3-1
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)