From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77624 invoked by alias); 25 Sep 2018 09:05:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 77575 invoked by uid 89); 25 Sep 2018 09:05:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 25 Sep 2018 09:05:46 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 62F7F3084028; Tue, 25 Sep 2018 09:05:45 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-68.ams2.redhat.com [10.36.116.68]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0530319487; Tue, 25 Sep 2018 09:05:44 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id w8P95gbY032763; Tue, 25 Sep 2018 11:05:43 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id w8P95exP032762; Tue, 25 Sep 2018 11:05:40 +0200 Date: Tue, 25 Sep 2018 09:25:00 -0000 From: Jakub Jelinek To: Martin Jambor Cc: GCC Patches Subject: Re: [PR 87347] Prevent segfaults if TYPE_ARG_TYPES is NULL Message-ID: <20180925090540.GB8250@tucnak> Reply-To: Jakub Jelinek References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg01408.txt.bz2 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