gjavah.c (decompile_method): Don't decompile to `return this' for static methods.
authorTom Tromey <tromey@redhat.com>
Sun, 9 Dec 2001 05:14:19 +0000 (05:14 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Sun, 9 Dec 2001 05:14:19 +0000 (05:14 +0000)
* gjavah.c (decompile_method): Don't decompile to `return this'
for static methods.

From-SVN: r47804

gcc/java/ChangeLog
gcc/java/gjavah.c

index f04ebf26daac22f83d84c5005222e5e56a660c2f..30e730fbc2f88e369f9d17217990102c5102351e 100644 (file)
@@ -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.
 
index 724877507e0071e09b3c19517ff3ef552494d539..1e93ddef4a63028d5e5422adcd7267db4c7e44bc 100644 (file)
@@ -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));