diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index ae7bba5264..c244e79d1d 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -4674,6 +4674,10 @@ jvmInvokeMethod(Thread* t, uintptr_t* arguments) (t, jclassVmClass(t, jmethodClazz(t, *method))), jmethodSlot(t, *method)); + if (instance and not instanceOf(t, methodClass(t, vmMethod), *instance)) { + throwNew(t, Machine::IllegalArgumentExceptionType); + } + return reinterpret_cast (makeLocalReference (t, invoke