diff options
author | Ranjit Mathew <rmathew@hotmail.com> | 2004-04-30 18:14:07 +0000 |
---|---|---|
committer | Ranjit Mathew <rmathew@gcc.gnu.org> | 2004-04-30 18:14:07 +0000 |
commit | 3fb577a58935b9b1be60200000422ead1a69f561 (patch) | |
tree | 7fe8152ed2c2c8729bfed1222c9bda338b620f08 | |
parent | 693446fc3343a269cf01f3bd6a6d2626951b59b5 (diff) | |
download | gcc-3fb577a58935b9b1be60200000422ead1a69f561.zip gcc-3fb577a58935b9b1be60200000422ead1a69f561.tar.gz gcc-3fb577a58935b9b1be60200000422ead1a69f561.tar.bz2 |
re PR java/15133 (gcjh generates wrong method signatures)
Fixes PR java/15133
* gjavah.c (struct method_name): Add member is_native.
(overloaded_jni_method_exists_p): Match candidate method only if
it is native.
(print_method_info): Initialise is_native flag from the method's
access flags.
From-SVN: r81357
-rw-r--r-- | gcc/java/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/java/gjavah.c | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 4a4017e..b566fff 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,12 @@ +2004-04-30 Ranjit Mathew <rmathew@hotmail.com> + + Fixes PR java/15133 + * gjavah.c (struct method_name): Add member is_native. + (overloaded_jni_method_exists_p): Match candidate method only if + it is native. + (print_method_info): Initialise is_native flag from the method's + access flags. + 2004-04-30 Roger Sayle <roger@eyesopen.com> * builtins.c (java_builtins): Add acos, asin, ceil and floor. diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index 0a09ab6..45e5f25 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -119,6 +119,7 @@ struct method_name int length; unsigned char *signature; int sig_length; + int is_native; struct method_name *next; }; @@ -634,7 +635,7 @@ name_is_method_p (const unsigned char *name, int length) return 0; } -/* If there is already a method named NAME, whose signature is not +/* If there is already a native method named NAME, whose signature is not SIGNATURE, then return true. Otherwise return false. */ static int overloaded_jni_method_exists_p (const unsigned char *name, int length, @@ -644,7 +645,8 @@ overloaded_jni_method_exists_p (const unsigned char *name, int length, for (p = method_name_list; p != NULL; p = p->next) { - if (p->length == length + if (p->is_native + && p->length == length && ! memcmp (p->name, name, length) && (p->sig_length != sig_length || memcmp (p->signature, signature, sig_length))) @@ -851,6 +853,7 @@ print_method_info (FILE *stream, JCF* jcf, int name_index, int sig_index, nn->next = method_name_list; nn->sig_length = JPOOL_UTF_LENGTH (jcf, sig_index); nn->signature = xmalloc (nn->sig_length); + nn->is_native = METHOD_IS_NATIVE (flags); memcpy (nn->signature, JPOOL_UTF_DATA (jcf, sig_index), nn->sig_length); method_name_list = nn; |