Fix a bug with list handling that caused this to abort with a "extraneous

<string>" message if the stars were aligned incorrectly due to fast-and-
loose list handling.

The list handling code didn't discriminate between list nodes and list
heads, resulting in string comparisons using memory in the "list heads
by length" array as the target of the comparison; if the string being
handled was short enough and the pointers present in the list heads
array were just the right form the tool would get spurious matches and
exit with the above message.

PR toolchain/18858
This commit is contained in:
rafal 2002-10-30 18:14:37 +00:00
parent 5f7d4eab6c
commit 2fdb31c4e3
1 changed files with 2 additions and 1 deletions

View File

@ -418,7 +418,8 @@ main (int argc, char **argv)
while ((n->next != (name) &names[len])
&& (strcmp (buf, n->next->name_uc) > 0))
n = n->next;
if (strcmp (buf, n->next->name_uc) == 0)
if (n->next != (name) &names[len]
&& strcmp (buf, n->next->name_uc) == 0)
{
fprintf (stderr, "%s: extraneous \"%s\"\n", input_name, buf);
do_exit = TRUE;