This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

[gcjx] Patch: FYI: compilation unit fix


I'm checking this in on the gcjx branch.

This fixes a dumb typo in the compilation unit code (stray semicolon)
and also changes it not to crash if a static import fails to find a
class.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* model/unit.cc (look_up_name): Handle case where static import
	doesn't import a class.
	(look_up_name): Fix typo.

Index: model/unit.cc
===================================================================
--- model/unit.cc	(revision 107604)
+++ model/unit.cc	(working copy)
@@ -106,7 +106,7 @@
 	  model_import *imp = (*i).second;
 	  resolve (&local_scope, imp);
 	  model_class *klass = imp->get_class_declaration ();
-	  if (accessible_p (klass, context))
+	  if (klass && accessible_p (klass, context))
 	    {
 	      imp->set_used ();
 	      result.insert (klass);
@@ -183,8 +183,8 @@
 
 	  (*i)->resolve (&local_scope);
 	  (*i)->find_field (name, context, result);
-	  if (! result.empty ());
-	  return;
+	  if (! result.empty ())
+	    return;
 	}
     }
 }


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