From 2c1f7acfa53e63dc17a2b10c0efa72a2f13eb349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lazar=20Mitrovi=C4=87?= Date: Thu, 7 May 2020 17:51:35 +0200 Subject: [PATCH] Fix attempt #3 --- .../oracle/svm/truffle/nfi/posix/PosixTruffleNFIFeature.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/substratevm/src/com.oracle.svm.truffle.nfi.posix/src/com/oracle/svm/truffle/nfi/posix/PosixTruffleNFIFeature.java b/substratevm/src/com.oracle.svm.truffle.nfi.posix/src/com/oracle/svm/truffle/nfi/posix/PosixTruffleNFIFeature.java index 83f66487df09..c382a6c64723 100644 --- a/substratevm/src/com.oracle.svm.truffle.nfi.posix/src/com/oracle/svm/truffle/nfi/posix/PosixTruffleNFIFeature.java +++ b/substratevm/src/com.oracle.svm.truffle.nfi.posix/src/com/oracle/svm/truffle/nfi/posix/PosixTruffleNFIFeature.java @@ -108,7 +108,7 @@ private static PointerBase dlmopen(Lmid_t lmid, String filename, int mode) { * A single linking namespace is created lazily and registered on the NFI context instance. */ private static PointerBase loadLibraryInNamespace(long nativeContext, String name, int mode) { - assert (mode & singleton().isolatedNamespaceFlag) == 0; + assert (LibCBase.singleton().hasIsolatedNamespaces()) == false; Target_com_oracle_truffle_nfi_impl_NFIContextLinux context = // KnownIntrinsics.convertUnknownValue(getContext(nativeContext), Target_com_oracle_truffle_nfi_impl_NFIContextLinux.class); @@ -147,8 +147,7 @@ private static PointerBase loadLibraryInNamespace(long nativeContext, String nam @Override protected long loadLibraryImpl(long nativeContext, String name, int flags) { PointerBase handle; - if (Platform.includedIn(Platform.LINUX.class) && isolatedNamespaceFlag == ISOLATED_NAMESPACE_FLAG // constant folding - && (flags & isolatedNamespaceFlag) != 0) { + if (Platform.includedIn(Platform.LINUX.class) && LibCBase.singleton().hasIsolatedNamespaces()) { handle = loadLibraryInNamespace(nativeContext, name, flags & ~isolatedNamespaceFlag); } else { handle = PosixUtils.dlopen(name, flags);