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

Commit4781535

Browse files
authored
ceval: Use _PyTuple_FromArraySteal in BUILD_TUPLE (GH-96516)
1 parentf2d749a commit4781535

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

‎Python/ceval.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2650,13 +2650,10 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
26502650
}
26512651

26522652
TARGET(BUILD_TUPLE) {
2653-
PyObject*tup=PyTuple_New(oparg);
2653+
STACK_SHRINK(oparg);
2654+
PyObject*tup=_PyTuple_FromArraySteal(stack_pointer,oparg);
26542655
if (tup==NULL)
26552656
gotoerror;
2656-
while (--oparg >=0) {
2657-
PyObject*item=POP();
2658-
PyTuple_SET_ITEM(tup,oparg,item);
2659-
}
26602657
PUSH(tup);
26612658
DISPATCH();
26622659
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp