8318737: Fallback linker passes bad JNI handle

Reviewed-by: alanb
This commit is contained in:
Jorn Vernee 2023-10-26 15:54:02 +00:00
parent 9864951dce
commit 3885dc5b9a
7 changed files with 32 additions and 16 deletions

View file

@ -43,11 +43,14 @@ final class LibFallback {
public Boolean run() {
try {
System.loadLibrary("fallbackLinker");
init();
return true;
} catch (UnsatisfiedLinkError ule) {
return false;
}
if (!init()) {
// library failed to initialize. Do not silently mark as unsupported
throw new ExceptionInInitializerError("Fallback library failed to initialize");
}
return true;
}
});
}
@ -201,7 +204,7 @@ final class LibFallback {
}
}
private static native void init();
private static native boolean init();
private static native long sizeofCif();