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: [PATCH] Allocate extra 16 bytes for -fsanitize=address


>>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:

Jakub> 2012-11-23  Jakub Jelinek  <jakub@redhat.com>
Jakub> 	PR bootstrap/55380
Jakub> 	* files.c (read_file_guts): Allocate extra 16 bytes instead of
Jakub> 	1 byte at the end of buf.  Pass size + 16 instead of size
Jakub> 	to _cpp_convert_input.
Jakub> 	* charset.c (_cpp_convert_input): Reallocate if there aren't
Jakub> 	at least 16 bytes beyond to.len in the buffer.  Clear 16 bytes
Jakub> 	at to.text + to.len.

Jakub> +  buf = XNEWVEC (uchar, size + 16);

I think the magic constant 16 could use a comment, here and elsewhere.

Otherwise ok.

Tom


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