]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-90699: Use _Py_STR(empty) instead of PyUnicode_New(0, 0) for BUILD_STRING (GH...
authorDennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
Fri, 15 Apr 2022 14:21:35 +0000 (10:21 -0400)
committerGitHub <noreply@github.com>
Fri, 15 Apr 2022 14:21:35 +0000 (23:21 +0900)
Python/ceval.c

index b46b1ef84293926c4f2c9b2f56076ad9d73ff909..7891547ffc687174baa12e2d2783904f5e3fd9f3 100644 (file)
@@ -3152,12 +3152,8 @@ handle_eval_breaker:
 
         TARGET(BUILD_STRING) {
             PyObject *str;
-            PyObject *empty = PyUnicode_New(0, 0);
-            if (empty == NULL) {
-                goto error;
-            }
-            str = _PyUnicode_JoinArray(empty, stack_pointer - oparg, oparg);
-            Py_DECREF(empty);
+            str = _PyUnicode_JoinArray(&_Py_STR(empty),
+                                       stack_pointer - oparg, oparg);
             if (str == NULL)
                 goto error;
             while (--oparg >= 0) {