Skip to content

Commit 6fa6a5d

Browse files
committed
Fix: HPyMethInitProcRoot must always return None
1 parent cbcbfe9 commit 6fa6a5d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/hpy/HPyExternalFunctionNodes.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
import com.oracle.graal.python.PythonLanguage;
4444
import com.oracle.graal.python.builtins.PythonBuiltinClassType;
45+
import com.oracle.graal.python.builtins.objects.PNone;
4546
import com.oracle.graal.python.builtins.objects.cext.hpy.GraalHPyDef.HPyFuncSignature;
4647
import com.oracle.graal.python.builtins.objects.cext.hpy.GraalHPyNodes.HPyAsPythonObjectNode;
4748
import com.oracle.graal.python.builtins.objects.cext.hpy.GraalHPyNodes.HPyConvertArgsToSulongNode;
@@ -469,6 +470,14 @@ protected Object[] prepareCArguments(VirtualFrame frame) {
469470
return new Object[]{getSelf(frame), new HPyArrayWrapper(args), (long) args.length, getKwargs(frame)};
470471
}
471472

473+
@Override
474+
@SuppressWarnings("unused")
475+
protected Object processResult(VirtualFrame frame, Object result) {
476+
// If no error occurred, the init function always returns None.
477+
// Possible errors are already handled in the HPyExternalFunctionInvokeNode.
478+
return PNone.NONE;
479+
}
480+
472481
private Object[] getVarargs(VirtualFrame frame) {
473482
if (readVarargsNode == null) {
474483
CompilerDirectives.transferToInterpreterAndInvalidate();

0 commit comments

Comments
 (0)