Skip to content

Commit

Permalink
ceval: Use _PyTuple_FromArraySteal in BUILD_TUPLE (GH-96516)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmod authored Sep 14, 2022
1 parent f2d749a commit 4781535
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -2650,13 +2650,10 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
}

TARGET(BUILD_TUPLE) {
PyObject *tup = PyTuple_New(oparg);
STACK_SHRINK(oparg);
PyObject *tup = _PyTuple_FromArraySteal(stack_pointer, oparg);
if (tup == NULL)
goto error;
while (--oparg >= 0) {
PyObject *item = POP();
PyTuple_SET_ITEM(tup, oparg, item);
}
PUSH(tup);
DISPATCH();
}
Expand Down

0 comments on commit 4781535

Please sign in to comment.