| Submitter | Basile Starynkevitch |
|---|---|
| Date | Oct. 17, 2010, 8:26 a.m. |
| Message ID | <20101017102619.b33e5b70.basile@starynkevitch.net> |
| Download | mbox | patch |
| Permalink | /patch/68068/ |
| State | New |
| Headers | show |
Comments
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,
Patch
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];