This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[ecj] Patch: FYI: don't decompile accessors
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 09 Jun 2006 11:15:36 -0600
- Subject: [ecj] Patch: FYI: don't decompile accessors
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcj-eclipse branch.
gcjh tried to decompile a static field accessor method, yielding
invalid C++ code.
This is a bug in the main line as well. We haven't hit it since gcj
is pretty bad about making accessor methods.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* gjavah.c (decompile_method): Don't decompile a static field
accessor method.
Index: gjavah.c
===================================================================
--- gjavah.c (revision 114451)
+++ gjavah.c (working copy)
@@ -1130,7 +1130,10 @@
if ((method_access & ACC_SYNCHRONIZED))
return;
- if (code_len == 5
+ /* The first case is 'return field'; but we only want to do this for
+ non-static methods. */
+ if (! (method_access & ACC_STATIC)
+ && code_len == 5
&& codes[0] == OPCODE_aload_0
&& codes[1] == OPCODE_getfield
&& (codes[4] == OPCODE_areturn