mirror of https://github.com/python/cpython
ceval: Use _PyTuple_FromArraySteal in BUILD_TUPLE (GH-96516)
This commit is contained in:
parent
f2d749a2c2
commit
4781535a57
|
@ -2650,13 +2650,10 @@ handle_eval_breaker:
|
|||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue