From: Dong-hee Na Date: Sat, 12 Aug 2023 19:36:46 +0000 (+0900) Subject: gh-106797: Remove warning logs from Python/generated_cases.c.h and executor_cases... X-Git-Tag: v3.13.0a1~986 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bf707749e87f47b2fee2a208a654511ac318d4b9;p=thirdparty%2FPython%2Fcpython.git gh-106797: Remove warning logs from Python/generated_cases.c.h and executor_cases.c.h (gh-107889) gh-106797: Remove warning logs from Python/generated_cases.c.h --- diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index a7b5054417ed..5e3c84b2b4b6 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -1513,7 +1513,7 @@ 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; } diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index ccf43c727b9e..2661a39e047c 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -2251,7 +2251,7 @@ 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(); } @@ -3574,7 +3574,7 @@ 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(); } @@ -3594,7 +3594,7 @@ 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(); } diff --git a/Tools/cases_generator/stacking.py b/Tools/cases_generator/stacking.py index d457ce01a8f4..9bb7f4684422 100644 --- a/Tools/cases_generator/stacking.py +++ b/Tools/cases_generator/stacking.py @@ -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