This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: FYI: Another gcjh bug fix
- From: Tom Tromey <tromey at redhat dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 08 Dec 2001 22:18:51 -0700
- Subject: Patch: FYI: Another gcjh bug fix
- Reply-to: tromey at redhat dot com
I'm checking this in.
gcjh would sometimes decompile a static method to `return this', which
doesn't make sense. I found this via `make header-check' in libgcj.
header-check still doesn't fully pass, but the remaining problems
aren't bugs in gcjh.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* gjavah.c (decompile_method): Don't decompile to `return this'
for static methods.
Index: gjavah.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/gjavah.c,v
retrieving revision 1.78
diff -u -r1.78 gjavah.c
--- gjavah.c 2001/12/09 05:06:45 1.78
+++ gjavah.c 2001/12/09 05:13:35
@@ -1065,7 +1065,10 @@
}
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));