public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Martin Jambor <mjambor@suse.cz>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PR 87347] Prevent segfaults if TYPE_ARG_TYPES is NULL
Date: Tue, 25 Sep 2018 09:25:00 -0000	[thread overview]
Message-ID: <20180925090540.GB8250@tucnak> (raw)
In-Reply-To: <ri6worahh82.fsf@suse.cz>

On Mon, Sep 24, 2018 at 08:40:13PM +0200, Martin Jambor wrote:
> Hi,
> 
> the warning for suspicious calls of abs-like functions segfaults if a
> user declared their own parameter-less-ish variant of abs like in the
> testcase below.  Fixed by looking whether there is any TYPE_ARG_TYPES
> before trying to compare the actual argument with it.
> 
> Bootstrapped and tested on x86_64-linux and aarch64-linux, the same on
> i686-linux is pending.
> 
> OK for trunk?

Isn't that bail out too early?
I mean most of the warnings that are emitted by the function don't really
need TYPE_ARG_TYPES, only the last one does, so can't you just bail out
before the last warning?

Also, the function comment has "gracely", did you mean "gracefully"?

	Jakub

  reply	other threads:[~2018-09-25  9:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 18:46 Martin Jambor
2018-09-25  9:25 ` Jakub Jelinek [this message]
2018-09-25 15:50   ` Martin Jambor
2018-09-25 16:10     ` Jakub Jelinek
2018-09-25 23:19       ` Joseph Myers

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=20180925090540.GB8250@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mjambor@suse.cz \
    /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).