From: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com> Date: Fri, 15 Apr 2022 14:21:35 +0000 (-0400) Subject: gh-90699: Use _Py_STR(empty) instead of PyUnicode_New(0, 0) for BUILD_STRING (GH... X-Git-Tag: v3.11.0b1~361 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=72965981d1128b3923dad5e850c8cff626ae4dc7;p=thirdparty%2FPython%2Fcpython.git gh-90699: Use _Py_STR(empty) instead of PyUnicode_New(0, 0) for BUILD_STRING (GH-91476) --- diff --git a/Python/ceval.c b/Python/ceval.c index b46b1ef84293..7891547ffc68 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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) {