10000 GH-125515: Reduce number of compiler warnings in generated code (GH-1… · python/cpython@2544159 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2544159

Browse files
authored
GH-125515: Reduce number of compiler warnings in generated code (GH-125697)
1 parent 19e93e2 commit 2544159

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

Include/internal/pycore_opcode_metadata.h

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

Python/bytecodes.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,9 @@ dummy_func(
974974
tstate->current_frame = frame->previous;
975975
assert(!_PyErr_Occurred(tstate));
976976
tstate->c_recursion_remaining += PY_EVAL_C_STACK_UNITS;
977-
return PyStackRef_AsPyObjectSteal(retval);
977+
PyObject *result = PyStackRef_AsPyObjectSteal(retval);
978+
SYNC_SP(); /* Not strictly necessary, but prevents warnings */
979+
return result;
978980
}
979981

980982
// The stack effect here is ambiguous.
@@ -1874,7 +1876,7 @@ dummy_func(
18741876
ERROR_IF(err != 0, error);
18751877
}
18761878

1877-
inst(INSTRUMENTED_LOAD_SUPER_ATTR, (unused/1, unused, unused, unused -- unused, unused if (oparg & 1))) {
1879+
inst(INSTRUMENTED_LOAD_SUPER_ATTR, (unused/1 -- )) {
18781880
// cancel out the decrement that will happen in LOAD_SUPER_ATTR; we
18791881
// don't want to specialize instrumented instructions
18801882
PAUSE_ADAPTIVE_COUNTER(this_instr[1].counter);

Python/generated_cases.c.h

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

Tools/cases_generator/tier2_generator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def declare_variables(uop: Uop, out: CWriter) -> None:
6464

6565

6666
class Tier2Emitter(Emitter):
67+
6768
def __init__(self, out: CWriter):
6869
super().__init__(out)
6970
self._replacers["oparg"] = self.oparg

0 commit comments

Comments
 (0)
0