summaryrefslogtreecommitdiffstats
path: root/Python/optimizer_analysis.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/optimizer_analysis.c')
-rw-r--r--Python/optimizer_analysis.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Python/optimizer_analysis.c b/Python/optimizer_analysis.c
index b9ac30e..5dd7725 100644
--- a/Python/optimizer_analysis.c
+++ b/Python/optimizer_analysis.c
@@ -109,10 +109,14 @@ convert_global_to_const(_PyUOpInstruction *inst, PyObject *obj)
return NULL;
}
if (_Py_IsImmortal(res)) {
- inst->opcode = (inst->oparg & 1) ? _LOAD_CONST_INLINE_BORROW_WITH_NULL : _LOAD_CONST_INLINE_BORROW;
+ inst->opcode = _LOAD_CONST_INLINE_BORROW;
}
else {
- inst->opcode = (inst->oparg & 1) ? _LOAD_CONST_INLINE_WITH_NULL : _LOAD_CONST_INLINE;
+ inst->opcode = _LOAD_CONST_INLINE;
+ }
+ if (inst->oparg & 1) {
+ assert(inst[1].opcode == _PUSH_NULL_CONDITIONAL);
+ assert(inst[1].oparg & 1);
}
inst->operand0 = (uint64_t)res;
return res;