Skip to content

Commit e77e169

Browse files
committed
since PyNumber_Float is now called directly and not through the landing func, we need to convert the NULL result to Sulong, too.
1 parent 1fccf3a commit e77e169

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/TruffleCextBuiltins.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,11 +2390,15 @@ Object doGeneric(@SuppressWarnings("unused") Object module, Object object) {
23902390
CompilerDirectives.transferToInterpreterAndInvalidate();
23912391
floatNode = insert(BuiltinConstructorsFactory.FloatNodeFactory.create(null));
23922392
}
2393+
return getToSulongNode().execute(floatNode.executeWith(PythonBuiltinClassType.PFloat, asPythonObjectNode.execute(object)));
2394+
}
2395+
2396+
private CExtNodes.ToSulongNode getToSulongNode() {
23932397
if (toSulongNode == null) {
23942398
CompilerDirectives.transferToInterpreterAndInvalidate();
23952399
toSulongNode = insert(CExtNodes.ToSulongNode.create());
23962400
}
2397-
return toSulongNode.execute(floatNode.executeWith(PythonBuiltinClassType.PFloat, asPythonObjectNode.execute(object)));
2401+
return toSulongNode;
23982402
}
23992403

24002404
@Specialization(replaces = "doGeneric")
@@ -2403,7 +2407,7 @@ Object doGenericErr(Object module, Object object) {
24032407
return doGeneric(module, object);
24042408
} catch (PException e) {
24052409
transformToNative(e);
2406-
return getNativeNull(module);
2410+
return getToSulongNode().execute(getNativeNull(module));
24072411
}
24082412
}
24092413
}

0 commit comments

Comments
 (0)