[gcjx] Patch: FYI: restructure find_decl
Tom Tromey
tromey@redhat.com
Tue Mar 8 23:14:00 GMT 2005
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
More information about the Java-patches
mailing list