diff options
author | Kevin Modzelewski <kmod@users.noreply.github.com> | 2022-09-14 03:44:32 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-14 03:44:32 (GMT) |
commit | 4781535a5796838fc4ce88e6e669e8907e426685 (patch) | |
tree | 98824a253ab3dd25261bc1a598ec2934a4a74258 /Python/ceval.c | |
parent | f2d749a2c2188fbca97d4b542f6b6ad4f58c2c71 (diff) | |
download | cpython-4781535a5796838fc4ce88e6e669e8907e426685.zip cpython-4781535a5796838fc4ce88e6e669e8907e426685.tar.gz cpython-4781535a5796838fc4ce88e6e669e8907e426685.tar.bz2 |
ceval: Use _PyTuple_FromArraySteal in BUILD_TUPLE (GH-96516)
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 091b0eb..1cf7246 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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(); } |