Skip to content

Commit 709a45f

Browse files
Get rid of spurious warnings
1 parent fe91ac3 commit 709a45f

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

Lib/test/test_generated_cases.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,6 +2541,8 @@ def test_replace_opcode_binop_one_output_insert(self):
25412541
l_stackref = left;
25422542
r_stackref = right;
25432543
/* End of uop copied from bytecodes for constant evaluation */
2544+
(void)l_stackref;
2545+
(void)r_stackref;
25442546
res = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal(res_stackref));
25452547
CHECK_STACK_BOUNDS(1);
25462548
stack_pointer[-2] = res;

Python/optimizer_cases.c.h

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/cases_generator/optimizer_generator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ def replace_opcode_if_evaluates_pure(
227227
emitter.emit_tokens(self.original_uop, storage, inst=None, emit_braces=False)
228228
self.out.start_line()
229229
emitter.emit("/* End of uop copied from bytecodes for constant evaluation */\n")
230+
for outp in self.original_uop.stack.outputs:
231+
if not outp.name == output_identifier.text:
232+
emitter.emit(f"(void){outp.name}_stackref;\n")
230233

231234
# Output stackref is created from new reference.
232235
emitter.emit(f"{output_identifier.text} = sym_new_const_steal(ctx, PyStackRef_AsPyObjectSteal({output_identifier.text}_stackref));\n")

0 commit comments

Comments
 (0)