diff --git a/Python/ceval.c b/Python/ceval.c index 1709dda0cbe145..46bf644106ac39 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -1228,6 +1228,8 @@ _Py_BuildString_StackRefSteal( goto cleanup; } res = _PyUnicode_JoinArray(&_Py_STR(empty), args_o, total_args); + STACKREFS_TO_PYOBJECTS_CLEANUP(args_o); + assert((res != NULL) ^ (PyErr_Occurred() != NULL)); cleanup: // arguments is a pointer into the GC visible stack, // so we must NULL out values as we clear them. @@ -1239,8 +1241,6 @@ _Py_BuildString_StackRefSteal( return res; } - - PyObject * _Py_BuildMap_StackRefSteal( _PyStackRef *arguments, @@ -1257,6 +1257,8 @@ _Py_BuildMap_StackRefSteal( args_o+1, 2, half_args ); + STACKREFS_TO_PYOBJECTS_CLEANUP(args_o); + assert((res != NULL) ^ (PyErr_Occurred() != NULL)); cleanup: // arguments is a pointer into the GC visible stack, // so we must NULL out values as we clear them.