summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-06-13 20:42:03 (GMT)
committerGitHub <noreply@github.com>2023-06-13 20:42:03 (GMT)
commitbe2779c0cb54e56ea4bb9822cc7bb5c24e6a7af7 (patch)
tree4789368f885f8e144876dd680987c532eafa66cf /Python/compile.c
parent2211454fe210637ed7fabda12690dac6cc9a8149 (diff)
downloadcpython-be2779c0cb54e56ea4bb9822cc7bb5c24e6a7af7.zip
cpython-be2779c0cb54e56ea4bb9822cc7bb5c24e6a7af7.tar.gz
cpython-be2779c0cb54e56ea4bb9822cc7bb5c24e6a7af7.tar.bz2
gh-105481: add flags to each instr in the opcode metadata table, to replace opcode.hasarg/hasname/hasconst (#105482)
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 589d92f..399a702 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -248,6 +248,8 @@ instr_sequence_use_label(instr_sequence *seq, int lbl) {
static int
instr_sequence_addop(instr_sequence *seq, int opcode, int oparg, location loc)
{
+ assert(!HAS_ARG(opcode) == !OPCODE_HAS_ARG(opcode));
+ assert(!HAS_CONST(opcode) == !OPCODE_HAS_CONST(opcode));
assert(0 <= opcode && opcode <= MAX_OPCODE);
assert(IS_PSEUDO_OPCODE(opcode) == IS_PSEUDO_INSTR(opcode));
assert(IS_WITHIN_OPCODE_RANGE(opcode));