public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Ian Lance Taylor via gcc-patches" <gcc-patches@gcc.gnu.org>
To: Tom Tromey <tom@tromey.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: RFA: libiberty: avoid UBSAN complaint in cplus-dem.c
Date: Fri, 27 Jul 2018 20:18:00 -0000	[thread overview]
Message-ID: <CAKOQZ8wq5j7EmUEfdVF0njxTBFMA=DiNdLQ8-QN1KF6Dt9PK6Q@mail.gmail.com> (raw)
In-Reply-To: <8736w4ppq6.fsf@tromey.com>

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

      reply	other threads:[~2018-07-27 20:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27 17:12 Tom Tromey
2018-07-27 20:18 ` Ian Lance Taylor via gcc-patches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKOQZ8wq5j7EmUEfdVF0njxTBFMA=DiNdLQ8-QN1KF6Dt9PK6Q@mail.gmail.com' \
    --to=gcc-patches@gcc.gnu.org \
    --cc=iant@google.com \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).