Skip to content
Snippets Groups Projects
Commit 9ebd4dab authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

unix/modjni: Don't pass Java object to a method which doesn't expect it.

For example, don't pass Integer to double method. This is still not
selective enough to choose the right overloaded method maong those
taking objects.
parent 9273cca4
No related branches found
No related tags found
No related merge requests found
...@@ -362,9 +362,19 @@ STATIC bool py2jvalue(const char **jtypesig, mp_obj_t arg, jvalue *out) { ...@@ -362,9 +362,19 @@ STATIC bool py2jvalue(const char **jtypesig, mp_obj_t arg, jvalue *out) {
} }
} else if (type == &jobject_type) { } else if (type == &jobject_type) {
printf("TODO: Check java arg type!!\n"); printf("TODO: Check java arg type!!\n");
while (isalpha(*arg_type) || *arg_type == '.') { bool is_object = false;
while (1) {
if (isalpha(*arg_type)) {
} else if (*arg_type == '.') {
is_object = true;
} else {
break;
}
arg_type++; arg_type++;
} }
if (!is_object) {
return false;
}
mp_obj_jobject_t *jo = arg; mp_obj_jobject_t *jo = arg;
out->l = jo->obj; out->l = jo->obj;
} else if (type == &mp_type_bool) { } else if (type == &mp_type_bool) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment