Skip to content

Commit 6f50f5b

Browse files
committed
convert result early, to make sure the pointer conversion will work with ERROR_MARKER
1 parent c5ca122 commit 6f50f5b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python.cext/src/longobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ void * PyLong_AsVoidPtr(PyObject *obj){
106106
}
107107

108108
PyObject * PyLong_FromLong(long n) {
109-
void *result = polyglot_invoke(PY_TRUFFLE_CEXT, "PyLong_FromLongLong", n, 1);
109+
void *result = to_sulong(polyglot_invoke(PY_TRUFFLE_CEXT, "PyLong_FromLongLong", n, 1));
110110
if (result == ERROR_MARKER) {
111111
return NULL;
112112
}
113-
return to_sulong(result);
113+
return result;
114114
}
115115

116116
PyObject * PyLong_FromLongLong(long long n) {

0 commit comments

Comments
 (0)