summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index 8844429..3ba0d0f 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -2282,22 +2282,20 @@ dummy_func(
JUMPBY(oparg * Py_IsTrue(cond));
}
- inst(POP_JUMP_IF_NOT_NONE, (value -- )) {
- if (!Py_IsNone(value)) {
- DECREF_INPUTS();
- JUMPBY(oparg);
- }
- }
-
- inst(POP_JUMP_IF_NONE, (value -- )) {
+ op(IS_NONE, (value -- b)) {
if (Py_IsNone(value)) {
- JUMPBY(oparg);
+ b = Py_True;
}
else {
+ b = Py_False;
DECREF_INPUTS();
}
}
+ macro(POP_JUMP_IF_NONE) = IS_NONE + POP_JUMP_IF_TRUE;
+
+ macro(POP_JUMP_IF_NOT_NONE) = IS_NONE + POP_JUMP_IF_FALSE;
+
inst(JUMP_BACKWARD_NO_INTERRUPT, (--)) {
/* This bytecode is used in the `yield from` or `await` loop.
* If there is an interrupt, we want it handled in the innermost