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: restructure find_decl


I'm checking this in on the gcjx branch.

Every time I looked at this function I was checking to make sure it
was really correct.  I rewrote it so I wouldn't keep doing that.

Tom

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

	* builtins.cc (find_decl): Restructured to use assert instead of
	abort.

Index: builtins.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/builtins.cc,v
retrieving revision 1.1.2.18
diff -u -r1.1.2.18 builtins.cc
--- builtins.cc 8 Mar 2005 21:39:25 -0000 1.1.2.18
+++ builtins.cc 8 Mar 2005 21:40:30 -0000
@@ -619,12 +619,17 @@
 {
   // This may only be called for local fields.
   tree tname = get_identifier (name);
+  tree result = NULL_TREE;
   for (tree field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
     {
       if (DECL_NAME (field) == tname)
-	return field;
+	{
+	  result = field;
+	  break;
+	}
     }
-  abort ();
+  assert (result != NULL_TREE);
+  return result;
 }
 
 std::string


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