From 1403447ddc31786720849deebab17352376e575a Mon Sep 17 00:00:00 2001 From: tromey Date: Tue, 7 Jan 2003 17:20:50 +0000 Subject: [PATCH] * class.c (add_assume_compiled): Don't adjust parent if we're already at the root of tree. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61003 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/ChangeLog | 5 +++++ gcc/java/class.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 8f3e2aa..e8150af 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2003-01-07 Tom Tromey + + * class.c (add_assume_compiled): Don't adjust parent if we're + already at the root of tree. + 2003-01-05 Kaveh R. Ghazi * lang.c (dump_compound_expr): Prototype. diff --git a/gcc/java/class.c b/gcc/java/class.c index 6e1055f..0818bc2 100644 --- a/gcc/java/class.c +++ b/gcc/java/class.c @@ -150,6 +150,7 @@ add_assume_compiled (ident, excludep) const char *ident; int excludep; { + int len; assume_compiled_node *parent; assume_compiled_node *node = xmalloc (sizeof (assume_compiled_node)); @@ -183,7 +184,8 @@ add_assume_compiled (ident, excludep) class or a package name. Adjust PARENT accordingly. */ parent = find_assume_compiled_node (assume_compiled_tree, ident); - if (ident[strlen (parent->ident)] != '.') + len = strlen (parent->ident); + if (parent->ident[len] && parent->ident[len] != '.') parent = parent->parent; /* Insert NODE into the tree. */ @@ -194,7 +196,7 @@ add_assume_compiled (ident, excludep) } /* Returns nonzero if IDENT is the name of a class that the compiler - should assume has been compiled to FIXME */ + should assume has been compiled to object code. */ static int assume_compiled (ident) -- 2.7.4