Message ID | 20101017102619.b33e5b70.basile@starynkevitch.net |
---|---|
State | New |
Headers | show |
2010/10/17 Basile Starynkevitch <basile@starynkevitch.net>: > There remains a bug in the code, plugin_files was not allocated. > 2010-10-17 Basile Starynkevitch <basile@starynkevitch.net> > * gengtype.c (parse_program_options): Allocate plugin_files. The patch is OK - and it is obvious, IMHO. However, while reviewing this I found the following in main: if (nb_plugin_files <= 0 || !plugin_files) fatal ("No plugin files given in plugin mode for %s", plugin_output_filename); nb_plugin_files is of size_t, which is unsigned. Please replace with ==. Thanks,
Index: gcc/gengtype.c =================================================================== --- gcc/gengtype.c (revision 165574) +++ gcc/gengtype.c (working copy) @@ -4395,6 +4395,7 @@ parse_program_options (int argc, char **argv) if (optind >= argc) fatal ("no source files given in plugin mode"); nb_plugin_files = argc - optind; + plugin_files = XNEWVEC (char*, nb_plugin_files); for (i = 0; i < (int) nb_plugin_files; i++) { char *name = argv[i + optind];