projects
/
cacao.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e2e9583
)
fix: jni_method_invokeNativeHelper static methods can ignore obj
author
motse
<none@none>
Wed, 5 Jan 2005 20:18:58 +0000
(20:18 +0000)
committer
motse
<none@none>
Wed, 5 Jan 2005 20:18:58 +0000
(20:18 +0000)
src/native/jni.c
patch
|
blob
|
history
diff --git
a/src/native/jni.c
b/src/native/jni.c
index 456b703cdac00aa0a0d9966ce434e9dc1f8a3075..b7d38fb86e3d47c6e4b428d9dab368fbb709a36c 100644
(file)
--- a/
src/native/jni.c
+++ b/
src/native/jni.c
@@
-28,7
+28,7
@@
Changes: Joseph Wenninger, Martin Platter
Changes: Joseph Wenninger, Martin Platter
- $Id: jni.c 18
56 2005-01-04 12:30:53Z twisti
$
+ $Id: jni.c 18
64 2005-01-05 20:18:58Z motse
$
*/
*/
@@
-3739,7
+3739,11
@@
jobject *jni_method_invokeNativeHelper(JNIEnv *env, struct methodinfo *methodID,
argcount = get_parametercount(methodID);
argcount = get_parametercount(methodID);
- if (obj && (!builtin_instanceof((java_objectheader *) obj, methodID->class))) {
+ /* the method is an instance method the obj has to be an instance of the
+ class the method belongs to. For static methods the obj parameter
+ is ignored. */
+ if (!(methodID->flags & ACC_STATIC) && obj &&
+ (!builtin_instanceof((java_objectheader *) obj, methodID->class))) {
*exceptionptr = new_exception_message(string_java_lang_IllegalArgumentException,
"Object parameter of wrong type in Java_java_lang_reflect_Method_invokeNative");
return 0;
*exceptionptr = new_exception_message(string_java_lang_IllegalArgumentException,
"Object parameter of wrong type in Java_java_lang_reflect_Method_invokeNative");
return 0;