From 72475fadcd225355a167c430c4cbbb08d1fc90b8 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 4 Aug 2023 19:52:31 -0700 Subject: [PATCH] Fix two tiny bugs in analysis.py --- Tools/cases_generator/analysis.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tools/cases_generator/analysis.py b/Tools/cases_generator/analysis.py index bd8918a87ffe08..2db1cd01c19ae5 100644 --- a/Tools/cases_generator/analysis.py +++ b/Tools/cases_generator/analysis.py @@ -297,6 +297,8 @@ def check_macro_consistency(self, mac: MacroInstruction) -> None: def get_var_names(instr: Instruction) -> dict[str, StackEffect]: vars: dict[str, StackEffect] = {} for eff in instr.input_effects + instr.output_effects: + if eff.name == UNUSED: + continue if eff.name in vars: if vars[eff.name] != eff: self.error( @@ -335,7 +337,7 @@ def get_var_names(instr: Instruction) -> dict[str, StackEffect]: copies: list[tuple[StackEffect, StackEffect]] = [] while pushes and pops and pushes[-1] == pops[0]: src, dst = pushes.pop(), pops.pop(0) - if src.name == dst.name or dst.name is UNUSED: + if src.name == dst.name or dst.name == UNUSED: continue copies.append((src, dst)) reads = set(copy[0].name for copy in copies)