perform any necessary argument conversion in JVM_NewInstanceFromConstructor

We must use the same utility function as JVM_InvokeMethod to ensure
that primitive arguments are unboxed when necessary.
This commit is contained in:
Joel Dice 2013-05-13 14:27:39 -06:00
parent 4b0bbd85e8
commit 4a69496ab4

View File

@ -4671,19 +4671,7 @@ jvmNewInstanceFromConstructor(Thread* t, uintptr_t* arguments)
(t, jclassVmClass(t, jconstructorClazz(t, *constructor))),
jconstructorSlot(t, *constructor));
THREAD_RESOURCE0(t, {
if (t->exception) {
object exception = t->exception;
t->exception = makeThrowable
(t, Machine::InvocationTargetExceptionType, 0, 0, exception);
}
});
if (args) {
t->m->processor->invokeArray(t, method, instance, *args);
} else {
t->m->processor->invoke(t, method, instance);
}
invoke(t, method, instance, args ? *args : 0);
return reinterpret_cast<uint64_t>(makeLocalReference(t, instance));
}