Skip to content

Commit e52bf8d

Browse files
committed
[svm] interp: Detect call to MethodNotCompiledHandler and error out
1 parent eda3202 commit e52bf8d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

substratevm/src/com.oracle.svm.interpreter/src/com/oracle/svm/interpreter/InterpreterToVM.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,12 @@ public static Object dispatchInvocation(InterpreterResolvedJavaMethod seedMethod
898898
VMError.guarantee(!forceStayInInterpreter);
899899
VMError.guarantee(calleeFtnPtr.isNonNull());
900900

901+
// Note: This won't work when PLTGOT is involved, because each method will have its
902+
// unique PLT stub address.
903+
if (calleeFtnPtr.equal(InterpreterMethodPointerHolder.getMethodNotCompiledHandler())) {
904+
VMError.shouldNotReachHere("Trying to dispatch to compiled code for AOT method " + seedMethod + " but it was not compiled because it was not seen as reachable by analysis");
905+
}
906+
901907
// wrapping of exceptions is done in leaveInterpreter
902908
retObj = InterpreterStubSection.leaveInterpreter(calleeFtnPtr, targetMethod, targetMethod.getDeclaringClass(), calleeArgs);
903909
} else {

0 commit comments

Comments
 (0)