Browse files

throw IllegalArgumentException in JVM_InvokeMethod on type mismatch

  • Loading branch information...
1 parent 49d8ccb commit 73547db7372c2b02fa1eecad678bd9b0c8fe4241 @dicej dicej committed Apr 9, 2013
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/classpath-openjdk.cpp
View
4 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<uint64_t>
(makeLocalReference
(t, invoke

0 comments on commit 73547db

Please sign in to comment.