java bytecode generation patch

Anthony Green green@cygnus.com
Sun Jan 9 17:22:00 GMT 2000


gcj was emitting invokeinterface bytecodes incorrectly in the case
where we are ignoring a return value.

It is obviously correct, and I'm checking it in.


2000-01-09  Anthony Green  <green@cygnus.com>

	    * jcf-write.c (generate_bytecode_insns): Emit invokeinterface
	    bytecodes in the correct order.


Index: gcc/java/jcf-write.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/jcf-write.c,v
retrieving revision 1.41
diff -u -r1.41 jcf-write.c
--- jcf-write.c	2000/01/07 20:28:11	1.41
+++ jcf-write.c	2000/01/10 01:16:56
@@ -2509,6 +2509,11 @@
 	    else
 	      OP1 (OPCODE_invokevirtual);
 	    OP2 (index);
+	    if (interface)
+	      {
+		OP1 (nargs);
+		OP1 (0);
+	      }
 	    f = TREE_TYPE (TREE_TYPE (f));
 	    if (TREE_CODE (f) != VOID_TYPE)
 	      {
@@ -2517,11 +2522,6 @@
 		  emit_pop (size, state);
 		else
 		  NOTE_PUSH (size);
-	      }
-	    if (interface)
-	      {
-		OP1 (nargs);
-		OP1 (0);
 	      }
 	    break;
 	  }

-- 
Anthony Green                                               Cygnus Solutions
                                                       Sunnyvale, California


More information about the Gcc-patches mailing list