diff options
author | Mark Shannon <mark@hotpy.org> | 2024-10-28 10:30:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-28 10:30:31 (GMT) |
commit | 25441592db179e9f5e6c896d1a691459a23e3422 (patch) | |
tree | 565b32cbd6c6a183cd9bb7a752d3645def108804 /Python | |
parent | 19e93e2e269889ecb3c4c039091abff489f247c2 (diff) | |
download | cpython-25441592db179e9f5e6c896d1a691459a23e3422.zip cpython-25441592db179e9f5e6c896d1a691459a23e3422.tar.gz cpython-25441592db179e9f5e6c896d1a691459a23e3422.tar.bz2 |
GH-125515: Reduce number of compiler warnings in generated code (GH-125697)
Diffstat (limited to 'Python')
-rw-r--r-- | Python/bytecodes.c | 6 | ||||
-rw-r--r-- | Python/generated_cases.c.h | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c index eaf2537..057ee0a 100644 --- a/Python/bytecodes.c +++ b/Python/bytecodes.c @@ -974,7 +974,9 @@ dummy_func( tstate->current_frame = frame->previous; assert(!_PyErr_Occurred(tstate)); tstate->c_recursion_remaining += PY_EVAL_C_STACK_UNITS; - return PyStackRef_AsPyObjectSteal(retval); + PyObject *result = PyStackRef_AsPyObjectSteal(retval); + SYNC_SP(); /* Not strictly necessary, but prevents warnings */ + return result; } // The stack effect here is ambiguous. @@ -1874,7 +1876,7 @@ dummy_func( ERROR_IF(err != 0, error); } - inst(INSTRUMENTED_LOAD_SUPER_ATTR, (unused/1, unused, unused, unused -- unused, unused if (oparg & 1))) { + inst(INSTRUMENTED_LOAD_SUPER_ATTR, (unused/1 -- )) { // cancel out the decrement that will happen in LOAD_SUPER_ATTR; we // don't want to specialize instrumented instructions PAUSE_ADAPTIVE_COUNTER(this_instr[1].counter); diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index f658ae5..35af1dc 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -4747,8 +4747,6 @@ // don't want to specialize instrumented instructions PAUSE_ADAPTIVE_COUNTER(this_instr[1].counter); GO_TO_INSTRUCTION(LOAD_SUPER_ATTR); - stack_pointer += -1; - assert(WITHIN_STACK_BOUNDS()); } TARGET(INSTRUMENTED_POP_JUMP_IF_FALSE) { @@ -5060,9 +5058,11 @@ tstate->current_frame = frame->previous; assert(!_PyErr_Occurred(tstate)); tstate->c_recursion_remaining += PY_EVAL_C_STACK_UNITS; - return PyStackRef_AsPyObjectSteal(retval); + PyObject *result = PyStackRef_AsPyObjectSteal(retval); stack_pointer += -1; assert(WITHIN_STACK_BOUNDS()); + /* Not strictly necessary, but prevents warnings */ + return result; } TARGET(IS_OP) { |