diff options
-rw-r--r-- | gcc/java/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/java/gjavah.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index f04ebf2..30e730f 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,5 +1,8 @@ 2001-12-08 Tom Tromey <tromey@redhat.com> + * gjavah.c (decompile_method): Don't decompile to `return this' + for static methods. + * gjavah.c (cxx_keywords): Re-sorted. * lex.c (cxx_keywords): Re-sorted. diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index 7248775..1e93dde 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -1065,7 +1065,10 @@ decompile_method (out, jcf, code_len) } else if (code_len == 2 && codes[0] == OPCODE_aload_0 - && codes[1] == OPCODE_areturn) + && codes[1] == OPCODE_areturn + /* We're going to generate `return this'. This only makes + sense for non-static methods. */ + && ! (method_access & ACC_STATIC)) { decompile_return_statement (out, jcf, method_signature, -1, JPOOL_USHORT1 (jcf, jcf->this_class)); |