diff options
| author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2023-02-03 14:40:45 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-03 14:40:45 (GMT) |
| commit | 433fb3ef08c71b97a0d08e522df56e0afaf3747a (patch) | |
| tree | cbb91c22b08ff5aa7f1552565911c1f37a6e7993 /Python/opcode_metadata.h | |
| parent | 04e06e20ee61f3c0d1d7a827b2feb4ed41bb198d (diff) | |
| download | cpython-433fb3ef08c71b97a0d08e522df56e0afaf3747a.zip cpython-433fb3ef08c71b97a0d08e522df56e0afaf3747a.tar.gz cpython-433fb3ef08c71b97a0d08e522df56e0afaf3747a.tar.bz2 | |
gh-98831: rewrite MAKE_FUNCTION and BUILD_SLICE in the instruction definition DSL (#101529)
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 256f81a..857526c 100644 --- a/Python/opcode_metadata.h +++ b/Python/opcode_metadata.h @@ -325,11 +325,11 @@ _PyOpcode_num_popped(int opcode, int oparg, bool jump) { case CALL_FUNCTION_EX: return -1; case MAKE_FUNCTION: - return -1; + return ((oparg & 0x01) ? 1 : 0) + ((oparg & 0x02) ? 1 : 0) + ((oparg & 0x04) ? 1 : 0) + ((oparg & 0x08) ? 1 : 0) + 1; case RETURN_GENERATOR: return 0; case BUILD_SLICE: - return -1; + return ((oparg == 3) ? 1 : 0) + 2; case FORMAT_VALUE: return -1; case COPY: @@ -671,11 +671,11 @@ _PyOpcode_num_pushed(int opcode, int oparg, bool jump) { case CALL_FUNCTION_EX: return -1; case MAKE_FUNCTION: - return -1; + return 1; case RETURN_GENERATOR: return 0; case BUILD_SLICE: - return -1; + return 1; case FORMAT_VALUE: return -1; case COPY: |
