Skip to content

Commit 4f64109

Browse files
committed
Fix invalid assert
1 parent 7728e5c commit 4f64109

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Python/optimizer_analysis.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ convert_global_to_const(_PyUOpInstruction *inst, PyObject *obj, bool pop, bool i
151151
if (insert) {
152152
if (_Py_IsImmortal(res)) {
153153
inst->opcode = _INSERT_1_LOAD_CONST_INLINE_BORROW;
154-
}
155-
else {
154+
} else {
156155
inst->opcode = _INSERT_1_LOAD_CONST_INLINE;
157156
}
158157
} else {
@@ -161,10 +160,10 @@ convert_global_to_const(_PyUOpInstruction *inst, PyObject *obj, bool pop, bool i
161160
} else {
162161
inst->opcode = pop ? _POP_TOP_LOAD_CONST_INLINE : _LOAD_CONST_INLINE;
163162
}
164-
}
165-
if (inst->oparg & 1) {
166-
assert(inst[1].opcode == _PUSH_NULL_CONDITIONAL);
167-
assert(inst[1].oparg & 1);
163+
if (inst->oparg & 1) {
164+
assert(inst[1].opcode == _PUSH_NULL_CONDITIONAL);
165+
assert(inst[1].oparg & 1);
166+
}
168167
}
169168
inst->operand0 = (uint64_t)res;
170169
return res;

0 commit comments

Comments
 (0)