[gcjx] Patch: FYI: definite assignment -vs- .class

Tom Tromey tromey@redhat.com
Sun Apr 17 20:49:00 GMT 2005


I'm checking this in on the gcjx branch.

Some of the definite assignment checks were done even for methods from
.class files, where this makes no sense.  This patch avoids this
problem.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* defassign.cc (definite_assignment_visitor::visit_bytecode_block):
	Just abort.
	(definite_assignment_visitor::visit_method): Do nothing for
	bytecode.

Index: defassign.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcjx/Attic/defassign.cc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 defassign.cc
--- defassign.cc 26 Jan 2005 01:26:04 -0000 1.1.2.3
+++ defassign.cc 17 Apr 2005 20:47:56 -0000
@@ -376,6 +376,10 @@
 		     const std::list<ref_variable_decl> &params,
 		     const ref_block &block)
   {
+    // Nothing to do for bytecode.
+    if (meth->get_declaring_class ()->from_class_p ())
+      return;
+
     if (current_class != NULL)
       {
 	// We might be called recursively in a single case.
@@ -491,8 +495,8 @@
   void visit_bytecode_block (model_bytecode_block *,
 			     int, int, int, const uint8 *)
   {
-    // There's no easy way to prevent this from being called.  There's
-    // also nothing to do.
+    // Can't get here.
+    abort ();
   }
 
   void visit_break (model_break *stmt, const ref_stmt &actual)



More information about the Java-patches mailing list