This is the mail archive of the gcc-patches@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]

Re: [pph] Buffer overrun in preprocessor symbol replay


On 11-03-09 09:01 PM, Lawrence Crowl wrote:

Index: gcc/cp/ChangeLog.pph

2011-03-09 Lawrence Crowl <crowl@google.com>

        * pph.c (pth_dump_identifiers): Split cpp_idents_used::max_length
        into max_ident_length and max_value_length.
	(pth_save_identifiers): Likewise.
	(pth_load_identifiers): Likewise.

Index: libcpp/ChangeLog.pph

2011-03-09 Lawrence Crowl <crowl@google.com>

        * include/symtab.h (struct cpp_idents_used): Split max_length
        into max_ident_len and max_value_len.
        * internal.h (struct cpp_lookaside): Split max_length into
        max_ident_len and max_value_len.
        * symtab.c (cpp_lt_create): Split cpp_lookaside::max_length
        into max_ident_len and max_value_len.
	* (lt_macro_value): Likewise.
	* (lt_lookup): Likewise.
        * (cpp_lt_capture): Likewise.  Also split cpp_idents_used::max_lenth
	into max_ident_len and max_value_len.
        * (cpp_lt_replay): Split cpp_idents_used::max_lenth into
        max_ident_len and max_value_len.  Allocate a buffer with the sum.

OK with minor nit.


unsigned int num_entries, id;

    num_entries = identifiers->num_entries;
!   pph_output_uint (stream, identifiers->max_ident_len);
!   pph_output_uint (stream, identifiers->max_value_len);
    pph_output_uint (stream, num_entries);

for ( id = 0; id < num_entries; ++id )

Extra space around '(' and ')' (this was there already, but I just noticed.)


Thanks for the quick fix! Were these the 3-4 ICEs I had noticed in pth.exp?


Diego.



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