ceval: Use _PyTuple_FromArraySteal in BUILD_TUPLE (GH-96516)

This commit is contained in:
Kevin Modzelewski 2022-09-13 23:44:32 -04:00 committed by GitHub
parent f2d749a2c2
commit 4781535a57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -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();
}