This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/25636] cc1 and cc1plus --help core



------- Comment #6 from drab at kepler dot fjfi dot cvut dot cz  2006-01-16 01:33 -------
(In reply to comment #2)
> Program received signal SIGSEGV, Segmentation fault.
> 0x083580bd in print_filtered_help (flag=536870912) at ../.././gcc/opts.c:1301
> 1301          memset (printed, 0, cl_options_count);
> (gdb) list
> 1296      if (flag == CL_COMMON || flag == CL_TARGET)
> 1297        {
> 1298          filter = flag;
> 1299          if (!printed)
> 1300            printed = xmalloc (cl_options_count);
> 1301          memset (printed, 0, cl_options_count);

This may be a problem in case when 'printed' is previously allocated to some
size that is less than the one that is given by the current 'cl_options_count'.
So perhaps this should rather be something like:

printed = xrealloc (printed, cl_options_count);
memset (printed, 0, cl_options_count);

That is if there is anything like 'xrealloc' (I didn't check), but you get the
idea. This should be safe, right?

(And BTW, I allways use "make bootstrap" with 3-stage compilation and the
result is the same, so that isn't the issue.)

> 1302        }
> ...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25636


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]