8315891: java/foreign/TestLinker.java failed with "error occurred while instantiating class TestLinker: null"

Reviewed-by: sundar, jvernee, pminborg
This commit is contained in:
Maurizio Cimadamore 2023-09-08 16:36:21 +00:00
parent 9559e035d2
commit a62c48b87e

View File

@ -36,14 +36,20 @@ final class LibFallback {
static final boolean SUPPORTED = tryLoadLibrary();
@SuppressWarnings("removal")
private static boolean tryLoadLibrary() {
try {
System.loadLibrary("fallbackLinker");
} catch (UnsatisfiedLinkError ule) {
return false;
}
init();
return true;
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<>() {
public Boolean run() {
try {
System.loadLibrary("fallbackLinker");
init();
return true;
} catch (UnsatisfiedLinkError ule) {
return false;
}
}
});
}
static int defaultABI() { return NativeConstants.DEFAULT_ABI; }