Skip to content

Commit 556a90c

Browse files
author
Pavel Marek
committed
Do not call asPointer on parameters to destructors.
1 parent 1ec59c3 commit 556a90c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

com.oracle.truffle.r.runtime/src/com/oracle/truffle/r/runtime/context/GlobalNativeVarContext.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,8 @@ public void callAllDestructors(RContext context, InteropLibrary interop) {
106106
Object ptrForDestructor = getGlobalVar(destructor.globalVarDescr, interop);
107107
interop.toNative(ptrForDestructor);
108108
assert interop.isPointer(ptrForDestructor);
109-
Object ptrForDestructorNative;
110-
try {
111-
ptrForDestructorNative = interop.asPointer(ptrForDestructor);
112-
} catch (UnsupportedMessageException e) {
113-
throw RInternalError.shouldNotReachHere(e);
114-
}
115109
Object ret = context.getRFFI().callNativeFunction(destructor.nativeFunc, destructor.nativeFuncType, Destructor.SIGNATURE,
116-
new Object[]{ptrForDestructorNative}, whichArgToWrap);
110+
new Object[]{ptrForDestructor}, whichArgToWrap);
117111
assert interop.isNull(ret);
118112
}
119113
}

0 commit comments

Comments
 (0)