changeset 16964:41f66e61b39a

NFI: fix FunctionHandle resolving
author Matthias Grimmer <grimmer@ssw.jku.at>
date Wed, 27 Aug 2014 09:13:00 +0200
parents 80fb94b07db2
children c0376739e835
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/HotSpotNativeFunctionInterface.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/HotSpotNativeFunctionInterface.java	Tue Aug 26 20:02:42 2014 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/HotSpotNativeFunctionInterface.java	Wed Aug 27 09:13:00 2014 +0200
@@ -146,8 +146,12 @@
 
     private HotSpotNativeFunctionHandle createHandle(NativeFunctionPointer functionPointer, Class<?> returnType, Class<?>... argumentTypes) {
         HotSpotNativeFunctionPointer hs = (HotSpotNativeFunctionPointer) functionPointer;
-        InstalledCode code = installNativeFunctionStub(hs.value, returnType, argumentTypes);
-        return new HotSpotNativeFunctionHandle(code, hs.name, argumentTypes);
+        if (hs != null) {
+            InstalledCode code = installNativeFunctionStub(hs.value, returnType, argumentTypes);
+            return new HotSpotNativeFunctionHandle(code, hs.name, argumentTypes);
+        } else {
+            return null;
+        }
     }
 
     /**