summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 813e0d5..09eb401 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -263,22 +263,32 @@ write_instr(_Py_CODEUNIT *codestr, struct instr *instruction, int ilen)
int caches = _PyOpcode_Caches[opcode];
switch (ilen - caches) {
case 4:
- *codestr++ = _Py_MAKECODEUNIT(EXTENDED_ARG, (oparg >> 24) & 0xFF);
+ codestr->opcode = EXTENDED_ARG;
+ codestr->oparg = (oparg >> 24) & 0xFF;
+ codestr++;
/* fall through */
case 3:
- *codestr++ = _Py_MAKECODEUNIT(EXTENDED_ARG, (oparg >> 16) & 0xFF);
+ codestr->opcode = EXTENDED_ARG;
+ codestr->oparg = (oparg >> 16) & 0xFF;
+ codestr++;
/* fall through */
case 2:
- *codestr++ = _Py_MAKECODEUNIT(EXTENDED_ARG, (oparg >> 8) & 0xFF);
+ codestr->opcode = EXTENDED_ARG;
+ codestr->oparg = (oparg >> 8) & 0xFF;
+ codestr++;
/* fall through */
case 1:
- *codestr++ = _Py_MAKECODEUNIT(opcode, oparg & 0xFF);
+ codestr->opcode = opcode;
+ codestr->oparg = oparg & 0xFF;
+ codestr++;
break;
default:
Py_UNREACHABLE();
}
while (caches--) {
- *codestr++ = _Py_MAKECODEUNIT(CACHE, 0);
+ codestr->opcode = CACHE;
+ codestr->oparg = 0;
+ codestr++;
}
}