@@ -638,8 +638,6 @@ protected abstract static class DlOpenNode extends PythonTernaryClinicBuiltinNod
638
638
639
639
private static final TruffleString MACOS_Security_LIB = tsLiteral ("/System/Library/Frameworks/Security.framework/Security" );
640
640
private static final TruffleString MACOS_CoreFoundation_LIB = tsLiteral ("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation" );
641
- // "LibFFILibrary(" + handle + ")"
642
- private static final int LIBFFI_ADR_FORMAT_START = "LibFFILibrary" .length () + 1 ;
643
641
644
642
private static final String T_RTLD_LOCAL = "RTLD_LOCAL|RTLD_NOW" ;
645
643
private static final String T_RTLD_GLOBAL = "RTLD_GLOBAL|RTLD_NOW" ;
@@ -668,19 +666,10 @@ protected static DLHandler loadNFILibrary(PythonContext context, NFIBackend back
668
666
}
669
667
Object handler = load (context , src , name );
670
668
InteropLibrary lib = InteropLibrary .getUncached ();
671
- String handleStr ;
672
669
try {
673
- handleStr = lib . asString ( lib .toDisplayString (handler ));
670
+ return new DLHandler ( handler , lib .asPointer (handler ), name , false );
674
671
} catch (UnsupportedMessageException e ) {
675
- throw CompilerDirectives .shouldNotReachHere ("toDisplayString result not convertible to String" );
676
- }
677
- String adrStr = handleStr .substring (LIBFFI_ADR_FORMAT_START , handleStr .length () - 1 );
678
- try {
679
- long adr = Long .parseLong (adrStr , 10 );
680
- return new DLHandler (handler , adr , name , false );
681
- } catch (NumberFormatException e ) {
682
- // TODO handle exception [GR-38101]
683
- throw CompilerDirectives .shouldNotReachHere ();
672
+ throw CompilerDirectives .shouldNotReachHere ("Cannot convert NFI library to pointer" , e );
684
673
}
685
674
}
686
675
0 commit comments