diff options
author | Jelle Zijlstra <jelle.zijlstra@gmail.com> | 2023-09-12 13:59:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-12 13:59:09 (GMT) |
commit | acde502e8a692a322ea43c69059c01cc8f6d5bad (patch) | |
tree | 8d34387011c656de22e6f8c052ae9031fb558fb2 /Python/opcode_metadata.h | |
parent | c76f4b97dcede6790a0e43d7d36179a298bbf0a6 (diff) | |
download | cpython-acde502e8a692a322ea43c69059c01cc8f6d5bad.zip cpython-acde502e8a692a322ea43c69059c01cc8f6d5bad.tar.gz cpython-acde502e8a692a322ea43c69059c01cc8f6d5bad.tar.bz2 |
[3.12] gh-109118: Fix runtime crash when NameError happens in PEP 695 function (GH-109123) (#109173)
* gh-109118: Fix runtime crash when NameError happens in PEP 695 function (#109123)
(cherry picked from commit 17f994174de9211b2baaff217eeb1033343230fc)
* [3.12] gh-109118: Fix runtime crash when NameError happens in PEP 695 function (GH-109123).
(cherry picked from commit 17f994174de9211b2baaff217eeb1033343230fc)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Diffstat (limited to 'Python/opcode_metadata.h')
-rw-r--r-- | Python/opcode_metadata.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/opcode_metadata.h b/Python/opcode_metadata.h index 53fbaa3..f9b1c92 100644 --- a/Python/opcode_metadata.h +++ b/Python/opcode_metadata.h @@ -163,10 +163,10 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) { return 0; case LOAD_LOCALS: return 0; - case LOAD_NAME: - return 0+1; case LOAD_FROM_DICT_OR_GLOBALS: return 1; + case LOAD_NAME: + return 0; case LOAD_GLOBAL: return 0; case LOAD_GLOBAL_MODULE: @@ -559,10 +559,10 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) { return 0; case LOAD_LOCALS: return 1; - case LOAD_NAME: - return 1+1; case LOAD_FROM_DICT_OR_GLOBALS: return 1; + case LOAD_NAME: + return 1; case LOAD_GLOBAL: return ((oparg & 1) ? 1 : 0) + 1; case LOAD_GLOBAL_MODULE: @@ -881,9 +881,9 @@ const struct opcode_metadata _PyOpcode_opcode_metadata[256] = { [DELETE_ATTR] = { true, INSTR_FMT_IB }, [STORE_GLOBAL] = { true, INSTR_FMT_IB }, [DELETE_GLOBAL] = { true, INSTR_FMT_IB }, - [LOAD_LOCALS] = { true, INSTR_FMT_IB }, - [LOAD_NAME] = { true, INSTR_FMT_IB }, + [LOAD_LOCALS] = { true, INSTR_FMT_IX }, [LOAD_FROM_DICT_OR_GLOBALS] = { true, INSTR_FMT_IB }, + [LOAD_NAME] = { true, INSTR_FMT_IB }, [LOAD_GLOBAL] = { true, INSTR_FMT_IBC000 }, [LOAD_GLOBAL_MODULE] = { true, INSTR_FMT_IBC000 }, [LOAD_GLOBAL_BUILTIN] = { true, INSTR_FMT_IBC000 }, |