diff options
-rw-r--r-- | Include/internal/pycore_opcode_metadata.h | 10 | ||||
-rw-r--r-- | Python/generated_cases.c.h | 8 | ||||
-rw-r--r-- | Tools/cases_generator/generate_cases.py | 10 |
3 files changed, 13 insertions, 15 deletions
diff --git a/Include/internal/pycore_opcode_metadata.h b/Include/internal/pycore_opcode_metadata.h index c3a0dbb..a5844b3 100644 --- a/Include/internal/pycore_opcode_metadata.h +++ b/Include/internal/pycore_opcode_metadata.h @@ -842,15 +842,15 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) { case PUSH_EXC_INFO: return 2; case LOAD_ATTR_METHOD_WITH_VALUES: - return 1 + 1; + return 2; case LOAD_ATTR_METHOD_NO_DICT: - return 1 + 1; + return 2; case LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES: - return 0 + 1; + return 1; case LOAD_ATTR_NONDESCRIPTOR_NO_DICT: - return 0 + 1; + return 1; case LOAD_ATTR_METHOD_LAZY_DICT: - return 1 + 1; + return 2; case KW_NAMES: return 0; case INSTRUMENTED_CALL: diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h index 0148078..0a8e4da 100644 --- a/Python/generated_cases.c.h +++ b/Python/generated_cases.c.h @@ -3356,7 +3356,7 @@ res = self; STACK_GROW(1); stack_pointer[-1] = res; - stack_pointer[-(1 + 1)] = res2; + stack_pointer[-2] = res2; next_instr += 9; DISPATCH(); } @@ -3378,7 +3378,7 @@ res = self; STACK_GROW(1); stack_pointer[-1] = res; - stack_pointer[-(1 + 1)] = res2; + stack_pointer[-2] = res2; next_instr += 9; DISPATCH(); } @@ -3403,7 +3403,6 @@ assert(descr != NULL); Py_DECREF(self); res = Py_NewRef(descr); - STACK_GROW(0); stack_pointer[-1] = res; next_instr += 9; DISPATCH(); @@ -3423,7 +3422,6 @@ assert(descr != NULL); Py_DECREF(self); res = Py_NewRef(descr); - STACK_GROW(0); stack_pointer[-1] = res; next_instr += 9; DISPATCH(); @@ -3450,7 +3448,7 @@ res = self; STACK_GROW(1); stack_pointer[-1] = res; - stack_pointer[-(1 + 1)] = res2; + stack_pointer[-2] = res2; next_instr += 9; DISPATCH(); } diff --git a/Tools/cases_generator/generate_cases.py b/Tools/cases_generator/generate_cases.py index 037bee1..2713fc6 100644 --- a/Tools/cases_generator/generate_cases.py +++ b/Tools/cases_generator/generate_cases.py @@ -99,7 +99,7 @@ def effect_size(effect: StackEffect) -> tuple[int, str]: return 0, effect.size elif effect.cond: if effect.cond in ("0", "1"): - return 0, effect.cond + return int(effect.cond), "" return 0, f"{maybe_parenthesize(effect.cond)} ? 1 : 0" else: return 1, "" @@ -841,9 +841,9 @@ class Analyzer: def check_families(self) -> None: """Check each family: - - Must have at least 2 members - - All members must be known instructions - - All members must have the same cache, input and output effects + - Must have at least 2 members (including head) + - Head and all members must be known instructions + - Head and all members must have the same cache, input and output effects """ for family in self.families.values(): if family.name not in self.macro_instrs and family.name not in self.instrs: @@ -868,7 +868,7 @@ class Analyzer: self.error( f"Family {family.name!r} has inconsistent " f"(cache, input, output) effects:\n" - f" {family.members[0]} = {expected_effects}; " + f" {family.name} = {expected_effects}; " f"{member} = {member_effects}", family, ) |