summaryrefslogtreecommitdiffstats
path: root/Python/opcode_metadata.h
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-02-02 10:02:57 (GMT)
committerGitHub <noreply@github.com>2023-02-02 10:02:57 (GMT)
commit0675b8f032c69d265468b31d5cadac6a7ce4bd9c (patch)
treec486ce5616413963e20d80b4e07c8030c556e5d3 /Python/opcode_metadata.h
parentee21110086e277a0ac24f5f768f35847b4db3380 (diff)
downloadcpython-0675b8f032c69d265468b31d5cadac6a7ce4bd9c.zip
cpython-0675b8f032c69d265468b31d5cadac6a7ce4bd9c.tar.gz
cpython-0675b8f032c69d265468b31d5cadac6a7ce4bd9c.tar.bz2
gh-98831: rewrite RERAISE and CLEANUP_THROW in the instruction definition DSL (#101511)
Diffstat (limited to 'Python/opcode_metadata.h')
-rw-r--r--Python/opcode_metadata.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/opcode_metadata.h b/Python/opcode_metadata.h
index f0bdede..ca3dde3 100644
--- a/Python/opcode_metadata.h
+++ b/Python/opcode_metadata.h
@@ -105,13 +105,13 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) {
case POP_EXCEPT:
return 1;
case RERAISE:
- return -1;
+ return oparg + 1;
case PREP_RERAISE_STAR:
return 2;
case END_ASYNC_FOR:
return 2;
case CLEANUP_THROW:
- return -1;
+ return 3;
case LOAD_ASSERTION_ERROR:
return 0;
case LOAD_BUILD_CLASS:
@@ -451,13 +451,13 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) {
case POP_EXCEPT:
return 0;
case RERAISE:
- return -1;
+ return oparg;
case PREP_RERAISE_STAR:
return 1;
case END_ASYNC_FOR:
return 0;
case CLEANUP_THROW:
- return -1;
+ return 1;
case LOAD_ASSERTION_ERROR:
return 1;
case LOAD_BUILD_CLASS: