diff options
author | Jelle Zijlstra <jelle.zijlstra@gmail.com> | 2024-05-22 00:46:39 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-22 00:46:39 (GMT) |
commit | 98e855fcc1f1d490c803565e84cb611b3f057e45 (patch) | |
tree | 53f19fb0244fa8c43e53534c31842adf5b65ebc2 /Objects | |
parent | 506b1a3ff66a41c72d205c8e4cba574e439d8e76 (diff) | |
download | cpython-98e855fcc1f1d490c803565e84cb611b3f057e45.zip cpython-98e855fcc1f1d490c803565e84cb611b3f057e45.tar.gz cpython-98e855fcc1f1d490c803565e84cb611b3f057e45.tar.bz2 |
gh-119180: Add LOAD_COMMON_CONSTANT opcode (#119321)
The PEP 649 implementation will require a way to load NotImplementedError
from the bytecode. @markshannon suggested implementing this by converting
LOAD_ASSERTION_ERROR into a more general mechanism for loading constants.
This PR adds this new opcode. I will work on the rest of the implementation
of the PEP separately.
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/codeobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 1c6b556..2ffda8d 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -863,7 +863,7 @@ PyUnstable_Code_New(int argcount, int kwonlyargcount, static const uint8_t assert0[6] = { RESUME, RESUME_AT_FUNC_START, - LOAD_ASSERTION_ERROR, 0, + LOAD_COMMON_CONSTANT, CONSTANT_ASSERTIONERROR, RAISE_VARARGS, 1 }; |