Skip to content

Commit f2e92b3

Browse files
committed
[svm] interp: Detect call to MethodNotCompiledHandler and error out
1 parent 3fe86c2 commit f2e92b3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

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

900+
// Note: This won't work when PLTGOT is involved, because each method will have its unique PLT stub address.
901+
if (calleeFtnPtr.equal(InterpreterMethodPointerHolder.getMethodNotCompiledHandler())) {
902+
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");
903+
}
904+
900905
// wrapping of exceptions is done in leaveInterpreter
901906
retObj = InterpreterStubSection.leaveInterpreter(calleeFtnPtr, targetMethod, targetMethod.getDeclaringClass(), calleeArgs);
902907
} else {

0 commit comments

Comments
 (0)