[gcjx] Patch: FYI: fix virtual dispatch

Tom Tromey tromey@redhat.com
Tue Mar 8 19:32:00 GMT 2005


I'm checking this in on the gcjx branch.

This makes sure that the "receiver" of a virtual call is wrapped by
save_expr.  Otherwise, bad things happen.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* abi.cc (build_method_call): For virtual dispatch, wrap object in
	SAVE_EXPR.

Index: abi.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/abi.cc,v
retrieving revision 1.1.2.11
diff -u -r1.1.2.11 abi.cc
--- abi.cc 8 Mar 2005 04:04:20 -0000 1.1.2.11
+++ abi.cc 8 Mar 2005 18:15:33 -0000
@@ -78,6 +78,8 @@
       // Virtual dispatch.
 
       assert (obj != NULL_TREE);
+      obj = save_expr (obj);
+
       args = tree_cons (NULL_TREE, obj, args);
 
       aot_class *aotk = builtins->get_class (meth->get_declaring_class ());



More information about the Java-patches mailing list