mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 23:25:24 +02:00
natMethod.cc (_Jv_CallAnyMethodA): Accept null `args' if method takes no parameters.
* java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Accept null `args' if method takes no parameters. From-SVN: r36209
This commit is contained in:
@@ -447,13 +447,17 @@ _Jv_CallAnyMethodA (jobject obj,
|
||||
{
|
||||
// FIXME: access checks.
|
||||
|
||||
if (parameter_types->length != args->length)
|
||||
if (parameter_types->length == 0 && args == NULL)
|
||||
{
|
||||
// The JDK accepts this, so we do too.
|
||||
}
|
||||
else if (parameter_types->length != args->length)
|
||||
JvThrow (new java::lang::IllegalArgumentException);
|
||||
|
||||
int param_count = parameter_types->length;
|
||||
|
||||
jclass *paramelts = elements (parameter_types);
|
||||
jobject *argelts = elements (args);
|
||||
jobject *argelts = args == NULL ? NULL : elements (args);
|
||||
jvalue argvals[param_count];
|
||||
|
||||
#define COPY(Where, What, Type) \
|
||||
|
||||
Reference in New Issue
Block a user