Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc0c041a

Browse files
authored
GH-106529: Define POP_JUMP_IF_NONE in terms of POP_JUMP_IF_TRUE (GH-106599)
1 parent1f2921b commitc0c041a

File tree

4 files changed

+281
-235
lines changed

4 files changed

+281
-235
lines changed

‎Python/bytecodes.c‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2282,22 +2282,20 @@ dummy_func(
22822282
JUMPBY(oparg*Py_IsTrue(cond));
22832283
}
22842284

2285-
inst(POP_JUMP_IF_NOT_NONE, (value-- )) {
2286-
if (!Py_IsNone(value)) {
2287-
DECREF_INPUTS();
2288-
JUMPBY(oparg);
2289-
}
2290-
}
2291-
2292-
inst(POP_JUMP_IF_NONE, (value-- )) {
2285+
op(IS_NONE, (value--b)) {
22932286
if (Py_IsNone(value)) {
2294-
JUMPBY(oparg);
2287+
b=Py_True;
22952288
}
22962289
else {
2290+
b=Py_False;
22972291
DECREF_INPUTS();
22982292
}
22992293
}
23002294

2295+
macro(POP_JUMP_IF_NONE)=IS_NONE+POP_JUMP_IF_TRUE;
2296+
2297+
macro(POP_JUMP_IF_NOT_NONE)=IS_NONE+POP_JUMP_IF_FALSE;
2298+
23012299
inst(JUMP_BACKWARD_NO_INTERRUPT, (--)) {
23022300
/* This bytecode is used in the `yield from` or `await` loop.
23032301
* If there is an interrupt, we want it handled in the innermost

‎Python/executor_cases.c.h‎

Lines changed: 66 additions & 48 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp