Skip to content

Commit 4d66965

Browse files
committed
another C99 fix
1 parent b20c5ac commit 4d66965

File tree

1 file changed

+4
-2
lines changed
  • graalpython/com.oracle.graal.python.test/src/tests/cpyext

1 file changed

+4
-2
lines changed

graalpython/com.oracle.graal.python.test/src/tests/cpyext/test_long.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,15 +277,17 @@ def compile_module(self, name):
277277
lambda: ((None,),),
278278
code="""PyObject* PyLong_FromAndToVoidPtrAllocated(PyObject* none) {
279279
unsigned long l = 0;
280+
void* unwrappedPtr;
281+
PyObject* result;
280282
void* dummyPtr = malloc(sizeof(size_t));
281283
PyObject* obj = PyLong_FromVoidPtr(dummyPtr);
282284
int r = PyObject_RichCompareBool(obj, Py_False, Py_LT);
283285
if (r < 0) {
284286
return Py_None;
285287
}
286288
l = PyLong_AsUnsignedLong(obj);
287-
void* unwrappedPtr = (void*)l;
288-
PyObject* result = unwrappedPtr == dummyPtr ? Py_True : Py_False;
289+
unwrappedPtr = (void*)l;
290+
result = unwrappedPtr == dummyPtr ? Py_True : Py_False;
289291
free(dummyPtr);
290292
return result;
291293
}

0 commit comments

Comments
 (0)