2011/4/17 Nicola Pero <nicola.p...@meta-innovation.com>:
> While reading GCC code, I noticed that in gengtype-state.c
> the equality function in a string hashtable is set to strcmp.
>
> But that returns 0 (ie, false for hashtable.c) when the strings
> are equal!  I can't see how that hashtable would ever work.  Do
> we have any tests for gengtype-state ?  Am I missing something ? :-)

The gengtype state is tested during normal bootstrap these days (the
state is dumped and the loaded back). After reading the code I think
that this bug is causing multiple copies of the same string in the
hashtable without any correctness issues, that's why we missed it.

> +2011-04-17  Nicola Pero  <nicola.p...@meta-innovation.com>
> +
> +       * gengtype-state.c (string_eq): New.
> +       (read_state): Use string_eq instead of strcmp when creating the
> +       state_ident_tab.
> +

The patch is OK. Thanks!

-- 
Laurynas

Reply via email to