diff --git a/Tools/cases_generator/stack.py b/Tools/cases_generator/stack.py index 35639a40a3a658..b44e48af09b3f0 100644 --- a/Tools/cases_generator/stack.py +++ b/Tools/cases_generator/stack.py @@ -301,7 +301,7 @@ def flush_single_var(self, out: CWriter, var_name: str, outputs: list[StackItem] base_offset = self.base_offset.copy() top_offset = self.top_offset.copy() for var in self.variables: - base_offset.push(var) + base_offset.push(var.item) for var in outputs: if any(var == v.item for v in self.variables): # The variable is already on the stack, such as a peeked value diff --git a/Tools/cases_generator/tier1_generator.py b/Tools/cases_generator/tier1_generator.py index 9ffe7745b88c54..1ea31a041ce3ae 100644 --- a/Tools/cases_generator/tier1_generator.py +++ b/Tools/cases_generator/tier1_generator.py @@ -119,11 +119,11 @@ def write_uop( emitter.emit(f"(void){cache.name};\n") offset += cache.size emitter.emit_tokens(uop, stack, inst) - for var in outputs: - if var.name in uop.deferred_refs.values(): + for output in outputs: + if output.name in uop.deferred_refs.values(): # We've already spilled this when emitting tokens - var.cached = False - emitter.emit(stack.push(var)) + output.cached = False + emitter.emit(stack.push(output)) if braces: emitter.out.start_line() emitter.emit("}\n") diff --git a/Tools/cases_generator/tier2_generator.py b/Tools/cases_generator/tier2_generator.py index 6e3b6c9c226b21..461375c71fae83 100644 --- a/Tools/cases_generator/tier2_generator.py +++ b/Tools/cases_generator/tier2_generator.py @@ -182,11 +182,11 @@ def write_uop(uop: Uop, emitter: Emitter, stack: Stack) -> None: cast = f"uint{cache.size*16}_t" emitter.emit(f"{type}{cache.name} = ({cast})CURRENT_OPERAND();\n") emitter.emit_tokens(uop, stack, None) - for var in outputs: - if var.name in uop.deferred_refs.values(): + for output in outputs: + if output.name in uop.deferred_refs.values(): # We've already spilled this when emitting tokens - var.cached = False - emitter.emit(stack.push(var)) + output.cached = False + emitter.emit(stack.push(output)) except StackError as ex: raise analysis_error(ex.args[0], uop.body[0]) from None