This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address
- From: Tom Tromey <tromey at redhat dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Uros Bizjak <ubizjak at gmail dot com>, gcc-patches at gcc dot gnu dot org
- Date: Mon, 03 Dec 2012 08:45:17 -0700
- Subject: Re: [PATCH] Allocate extra 16 bytes for -fsanitize=address
- References: <CAFULd4autWYL1fJiVQeSZnM143uhR1uX6wOkaMkSTDvTcUb2tA@mail.gmail.com> <CAMe9rOrnoq0xJE2Cayn+EAbBqJCUA1wXtNUxkV-nhEe4AC6K+A@mail.gmail.com> <CAFULd4ZzZHdnuMPbi6HJm8BmNFe5jB0Kz9jD5eOyPFcjD5c6sQ@mail.gmail.com> <CAMe9rOo_QGc047gYobb+PxnbznU8g+CK9acHVckgXo1d7zJ8FQ@mail.gmail.com> <20121123195033.GG2315@tucnak.redhat.com>
>>>>> "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