Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c15c4f1

Browse files
committed
SF bug [#467265] Compile errors on SuSe Linux on IBM/s390.
Unknown whether this fixes it. - stringobject.c, PyString_FromFormatV: don't assume that va_list is of a type that can be copied via an initializer. - errors.c, PyErr_Format: add a va_end() to balance the va_start().
1 parent 048eb75 commit c15c4f1

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

Objects/stringobject.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,17 @@ PyString_FromString(const char *str)
150150
PyObject *
151151
PyString_FromFormatV(const char *format, va_list vargs)
152152
{
153-
va_list count = vargs;
153+
va_list count;
154154
int n = 0;
155155
const char* f;
156156
char *s;
157157
PyObject* string;
158158

159+
#ifdef VA_LIST_IS_ARRAY
160+
memcpy(count, vargs, sizeof(va_list));
161+
#else
162+
count = vargs;
163+
#endif
159164
/* step 1: figure out how large a buffer we need */
160165
for (f = format; *f; f++) {
161166
if (*f == '%') {

Python/errors.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ PyErr_Format(PyObject *exception, const char *format, ...)
407407
string = PyString_FromFormatV(format, vargs);
408408
PyErr_SetObject(exception, string);
409409
Py_XDECREF(string);
410-
410+
va_end(vargs);
411411
return NULL;
412412
}
413413

0 commit comments

Comments
 (0)