https://github.com/python/cpython/commit/0c8c665581ede95fe119f902b070e395614b78ed
commit: 0c8c665581ede95fe119f902b070e395614b78ed
branch: main
author: sobolevn <[email protected]>
committer: sobolevn <[email protected]>
date: 2024-10-14T23:46:17+03:00
summary:

gh-125470: Fix warning in `Python/generated_cases.c.h` (#125471)

Co-authored-by: Kirill Podoprigora <[email protected]>

files:
M Python/bytecodes.c
M Python/executor_cases.c.h
M Python/generated_cases.c.h

diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index b22916aeaa248b..e6525657cabc2b 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -611,7 +611,9 @@ dummy_func(
         // specializations, but there is no output.
         // At the end we just skip over the STORE_FAST.
         op(_BINARY_OP_INPLACE_ADD_UNICODE, (left, right --)) {
+        #ifndef NDEBUG
             PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
+        #endif
             PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
 
             int next_oparg;
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h
index 0ed361a2ee7fb0..15a6c7bc1a7966 100644
--- a/Python/executor_cases.c.h
+++ b/Python/executor_cases.c.h
@@ -737,7 +737,9 @@
             _PyStackRef left;
             right = stack_pointer[-1];
             left = stack_pointer[-2];
+            #ifndef NDEBUG
             PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
+            #endif
             PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
             int next_oparg;
             #if TIER_ONE
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index 7bd1b7dd5aba27..a9290986c24f45 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -183,7 +183,9 @@
             /* Skip 1 cache entry */
             // _BINARY_OP_INPLACE_ADD_UNICODE
             {
+                #ifndef NDEBUG
                 PyObject *left_o = PyStackRef_AsPyObjectBorrow(left);
+                #endif
                 PyObject *right_o = PyStackRef_AsPyObjectBorrow(right);
                 int next_oparg;
                 #if TIER_ONE

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to