mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
[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 commit17f994174d
) * [3.12] gh-109118: Fix runtime crash when NameError happens in PEP 695 function (GH-109123). (cherry picked from commit17f994174d
) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
c76f4b97dc
commit
acde502e8a
5 changed files with 522 additions and 451 deletions
|
@ -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 },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue