This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: Another gcjh bug fix

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.


Index: ChangeLog
from  Tom Tromey  <>
	* 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));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]