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: RFA: libiberty: avoid UBSAN complaint in cplus-dem.c


On Fri, Jul 27, 2018 at 10:12 AM, Tom Tromey <tom@tromey.com> wrote:
> I built gdb with -fsanitize=undefined, and there was a complaint coming
> from cplus-dem.c.  remember_Btype can call memcpy with a NULL pointer,
> which is undefined behavior according to the C standard.
>
> This patch fixes the problem for me.  I tested this by rebuilding gdb
> (with -fsanitize=undefined) and re-running the test suite.
>
> Ok?
>
> Tom
>
> 2018-07-27  Tom Tromey  <tom@tromey.com>
>
>         * cplus-dem.c (remember_Btype): Don't call memcpy with LEN==0.

This is OK.

Thanks.

Ian


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