summaryrefslogtreecommitdiffstats
path: root/Python/assemble.c
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2023-06-11 21:31:59 (GMT)
committerGitHub <noreply@github.com>2023-06-11 21:31:59 (GMT)
commit58f5227d7cdff803609a0bda6882997b3a5ec4bf (patch)
tree59cedf6d505015a2876a13da499894bcb8969f93 /Python/assemble.c
parent20a56d8becba1a5a958b167fdb43b1a1b9228095 (diff)
downloadcpython-58f5227d7cdff803609a0bda6882997b3a5ec4bf.zip
cpython-58f5227d7cdff803609a0bda6882997b3a5ec4bf.tar.gz
cpython-58f5227d7cdff803609a0bda6882997b3a5ec4bf.tar.bz2
gh-105481: add pseudo-instructions to the bytecodes DSL (#105506)
Diffstat (limited to 'Python/assemble.c')
-rw-r--r--Python/assemble.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/assemble.c b/Python/assemble.c
index 24ecc71..85c6fe7 100644
--- a/Python/assemble.c
+++ b/Python/assemble.c
@@ -4,6 +4,7 @@
#include "pycore_code.h" // write_location_entry_start()
#include "pycore_compile.h"
#include "pycore_opcode.h" // _PyOpcode_Caches[] and opcode category macros
+#include "opcode_metadata.h" // IS_PSEUDO_INSTR
#define DEFAULT_CODE_SIZE 128
@@ -338,7 +339,8 @@ static void
write_instr(_Py_CODEUNIT *codestr, instruction *instr, int ilen)
{
int opcode = instr->i_opcode;
- assert(!IS_PSEUDO_OPCODE(opcode));
+ assert(IS_PSEUDO_OPCODE(opcode) == IS_PSEUDO_INSTR(opcode));
+ assert(!IS_PSEUDO_INSTR(opcode));
int oparg = instr->i_oparg;
assert(HAS_ARG(opcode) || oparg == 0);
int caches = _PyOpcode_Caches[opcode];