From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1C2913858D35 for ; Fri, 9 Jun 2023 20:17:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1C2913858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686341843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G/LFm6vn528zbSahbemjUSbkckyPPvextFm1VkWsVtM=; b=YABB/qjJryXiMONoQXBxC34AIccKU284s8LbJ594ebo+sT2eJz3UkbwvTUbxriMrL52qsg JOInBNHUSCu4FU7VJMyOXXdS+lPlMzmps4M0bOT+P8QqXHnra3VrFaWvsCafsUMV4e+YIR hJe9+oagps5oFfPEUuzypWlt+iX6Bq0= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-387-cFYjMlBHN1CXI7WDTVcd0A-1; Fri, 09 Jun 2023 16:17:22 -0400 X-MC-Unique: cFYjMlBHN1CXI7WDTVcd0A-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-75edaf118b4so305661485a.0 for ; Fri, 09 Jun 2023 13:17:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686341841; x=1688933841; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=G/LFm6vn528zbSahbemjUSbkckyPPvextFm1VkWsVtM=; b=OKlJFJ0oyny8dbvjsblPFrEAtslZ0YkZPi7YEvGk+NP+eLe9t7HcbAD0tfenziEW46 yVEHAVmKpBCQWDGYsXXRMCEjVk6/hdHLBoyGeO/2FoTNwqL/AjmXwHvXVqMqnOiNfbjy xSibHunsrjgFelTSIYC0a4ynqy03cTU0S593SrhswBeISmXjC7bo+NcGoduX5NKOjzJF ECl7jtq0ncBzCPJZ0OLxkAmNvhlD1P7d0+ui1rANcf1crN0EIS1eQfR4Xy83oqxofjxh GUXfYKZ51ZMKHsryHswcWnblHJ5hVYTnwye9y8M2Q+xtObLIfSqANZn1HvMUG+neUGT3 nKuA== X-Gm-Message-State: AC+VfDzZH3I9/qFTCZlpX5Yyj7gB4bsLY6hSZSSGSdm8b2Q6MdwLPqE6 7De73DQ2X0ylnGgzo3HOJO9+Ui/pm0cKjDgAWcvf90DEo+PKDmFGIQ2LCcHrWDb22N8SH+mgybI VsGr2cJE7HDEQjXQozQ== X-Received: by 2002:a05:620a:4ee:b0:75d:506c:a83a with SMTP id b14-20020a05620a04ee00b0075d506ca83amr2375389qkh.75.1686341841657; Fri, 09 Jun 2023 13:17:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5CG2oChdU9X2uibzJUDLwPGgC/XTY9Fh6HAkKhi8qIJuno5F+Cpdgjejcp5wXFBofccEEMWw== X-Received: by 2002:a05:620a:4ee:b0:75d:506c:a83a with SMTP id b14-20020a05620a04ee00b0075d506ca83amr2375379qkh.75.1686341841370; Fri, 09 Jun 2023 13:17:21 -0700 (PDT) Received: from t14s.localdomain (c-76-28-97-5.hsd1.ma.comcast.net. [76.28.97.5]) by smtp.gmail.com with ESMTPSA id o15-20020ae9f50f000000b007590aa4b115sm1260825qkg.87.2023.06.09.13.17.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 13:17:20 -0700 (PDT) Message-ID: Subject: Re: [PATCH 1/2] analyzer: Fix allocation size false positive on conjured svalue [PR109577] From: David Malcolm To: Tim Lange , gcc-patches@gcc.gnu.org Date: Fri, 09 Jun 2023 16:17:19 -0400 In-Reply-To: <20230609182813.72319-1-mail@tim-lange.me> References: <20230609182813.72319-1-mail@tim-lange.me> User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 2023-06-09 at 20:28 +0200, Tim Lange wrote: [...snip...] Thanks for the patch. > diff --git a/gcc/analyzer/constraint-manager.cc b/gcc/analyzer/constraint= -manager.cc > index 2c9c435527e..24cd8960098 100644 > --- a/gcc/analyzer/constraint-manager.cc > +++ b/gcc/analyzer/constraint-manager.cc > @@ -2218,6 +2218,137 @@ constraint_manager::get_equiv_class_by_svalue (co= nst svalue *sval, > =C2=A0=C2=A0 return false; > =C2=A0} > =C2=A0 > +/* Tries to find a svalue inside another svalue.=C2=A0 */ > + > +class sval_finder : public visitor > +{ > +public: > +=C2=A0 sval_finder (const svalue *query) : m_query (query) > +=C2=A0 { > +=C2=A0 } It looks like this ctor is missing an initialization of the new field "m_found" to false. [...snip...] > +private: > +=C2=A0 const svalue *m_query; > +=C2=A0 bool m_found; > +}; > + [...snip...] Other than that, looks good to me. Dave