]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-106797: Remove warning logs from Python/generated_cases.c.h and executor_cases...
authorDong-hee Na <donghee.na@python.org>
Sat, 12 Aug 2023 19:36:46 +0000 (04:36 +0900)
committerGitHub <noreply@github.com>
Sat, 12 Aug 2023 19:36:46 +0000 (04:36 +0900)
gh-106797: Remove warning logs from Python/generated_cases.c.h

Python/executor_cases.c.h
Python/generated_cases.c.h
Tools/cases_generator/stacking.py

index a7b5054417ed8f321eee7932fc8cf5b811a65fe5..5e3c84b2b4b612481c5eae107ed8b5ec250c7976 100644 (file)
             Py_DECREF(self);
             if (attr == NULL) goto pop_3_error;
             STACK_SHRINK(2);
-            stack_pointer[-1 - (0 ? 1 : 0)] = attr;
+            stack_pointer[-1] = attr;
             break;
         }
 
index ccf43c727b9e0f2f1755a505197288acfd6cac3a..2661a39e047c4d28293f4423f799416151f9496e 100644 (file)
             Py_DECREF(self);
             if (attr == NULL) goto pop_3_error;
             STACK_SHRINK(2);
-            stack_pointer[-1 - (0 ? 1 : 0)] = attr;
+            stack_pointer[-1] = attr;
             next_instr += 1;
             DISPATCH();
         }
             assert(descr != NULL);
             Py_DECREF(owner);
             attr = Py_NewRef(descr);
-            stack_pointer[-1 - (0 ? 1 : 0)] = attr;
+            stack_pointer[-1] = attr;
             next_instr += 9;
             DISPATCH();
         }
             assert(descr != NULL);
             Py_DECREF(owner);
             attr = Py_NewRef(descr);
-            stack_pointer[-1 - (0 ? 1 : 0)] = attr;
+            stack_pointer[-1] = attr;
             next_instr += 9;
             DISPATCH();
         }
index d457ce01a8f438d3e677cf13a0ea6b4f6792df95..9bb7f468442245ad3299c48761e51611dc6f95e6 100644 (file)
@@ -61,14 +61,14 @@ class StackOffset:
         for eff in self.deep:
             if eff.size:
                 terms.append(("-", maybe_parenthesize(eff.size)))
-            elif eff.cond and eff.cond != "1":
+            elif eff.cond and eff.cond not in ("0", "1"):
                 terms.append(("-", f"({parenthesize_cond(eff.cond)} ? 1 : 0)"))
             elif eff.cond != "0":
                 num -= 1
         for eff in self.high:
             if eff.size:
                 terms.append(("+", maybe_parenthesize(eff.size)))
-            elif eff.cond and eff.cond != "1":
+            elif eff.cond and eff.cond not in ("0", "1"):
                 terms.append(("+", f"({parenthesize_cond(eff.cond)} ? 1 : 0)"))
             elif eff.cond != "0":
                 num += 1