Commit 9e7817ed authored by Marius Wachtler's avatar Marius Wachtler

Merge pull request #1151 from Daetalus/ref_nexedi_str

Fix the test_string segfault error
parents b74be94e e1f9db5b
# expected: reffail
# - leaked refs
"Test posix functions"
from test import test_support
......
# expected: reffail
# - unknown segfault
import unittest, string
from test import test_support, string_tests
from UserList import UserList
......
......@@ -6911,8 +6911,11 @@ posix_fdopen(PyObject *self, PyObject *args)
#endif
Py_END_ALLOW_THREADS
PyMem_FREE(mode);
if (fp == NULL)
// Pyston change: decref the file object when throw exception
if (fp == NULL) {
Py_DECREF(f);
return posix_error();
}
/* We now know we will succeed, so initialize the file object. */
((PyFileObject *)f)->f_fp = fp;
PyFile_SetBufSize(f, bufsize);
......
......@@ -313,7 +313,7 @@ Box* BoxedMethodDescriptor::tppCall(Box* _self, CallRewriteArgs* rewrite_args, A
Box** oargs = NULL;
Box* oargs_array[1];
Box* oargs_array[1] = { NULL };
if (paramspec.totalReceived() > 3) {
assert((paramspec.totalReceived() - 3) <= sizeof(oargs_array) / sizeof(oargs_array[0]));
oargs = oargs_array;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment