diff options
| author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-02-06 22:45:18 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-06 22:45:18 (GMT) |
| commit | 38752760c91c87dd67af16d2cee611a22e647567 (patch) | |
| tree | 824cac44876b08b47e878044d215357581d74343 /Python/opcode_metadata.h | |
| parent | 949c58f945b93af5b7bb70c6448e940da669065d (diff) | |
| download | cpython-38752760c91c87dd67af16d2cee611a22e647567.zip cpython-38752760c91c87dd67af16d2cee611a22e647567.tar.gz cpython-38752760c91c87dd67af16d2cee611a22e647567.tar.bz2 | |
gh-98831: rewrite COPY and SWAP in the instruction definition DSL (#101620)
Diffstat (limited to 'Python/opcode_metadata.h')
| -rw-r--r-- | Python/opcode_metadata.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/opcode_metadata.h b/Python/opcode_metadata.h index 857526c..948d175 100644 --- a/Python/opcode_metadata.h +++ b/Python/opcode_metadata.h @@ -333,11 +333,11 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) { case FORMAT_VALUE: return -1; case COPY: - return -1; + return (oparg-1) + 1; case BINARY_OP: return 2; case SWAP: - return -1; + return (oparg-2) + 2; case EXTENDED_ARG: return 0; case CACHE: @@ -679,11 +679,11 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) { case FORMAT_VALUE: return -1; case COPY: - return -1; + return (oparg-1) + 2; case BINARY_OP: return 1; case SWAP: - return -1; + return (oparg-2) + 2; case EXTENDED_ARG: return 0; case CACHE: |
