From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id 146DE3857C60 for ; Fri, 27 Aug 2021 12:44:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 146DE3857C60 Received: by mail-pl1-x62e.google.com with SMTP id u1so63659plq.5 for ; Fri, 27 Aug 2021 05:44:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=LrDP0KmY549fl8ryWsEIpBoud7PZPNgBWz9YA5kCvHc=; b=me1G4WiQa2KhFD0RciDdU1dFhcXX/glcI4LMGTNQMBl6RucY6dGCA5HhcZBvNLkGxT BTVf7xj1RbdpW4fs0+Wso/rkkULTfpm7r2wN1VJ0Z3M+7w8DeRqeYCD7OePv2syIVxBP jy7jlfEOejvEg4NehW2pySnZRmd1zpLD/xX7+mKHDtjyw9gAd++bcXoi/+wTJZBSrckD AbXe9CIVij6WAilmMWbQ2Y03vZ+uFS8MlYNK4hzuJ80AyHBAIWrmv8bb/Wiwg8AgmMa8 yM38E6bpXfUjyLtZExqw5W1TCWaPA5ZL7TlL6Ybstmrdrhcp9dFe0EZ3SF2lP6MxBn8M ZRnw== X-Gm-Message-State: AOAM533aLHjKBNtEO4qlM56grumcCIzQz+ICaStM8BVW04frle7Om9e/ rgTwI2hd0m5mY28xNZrhxiY= X-Google-Smtp-Source: ABdhPJxNGLnvgF4BVIFkQXUICbcQNmNq7HmlA0uk70mlsSOMgzz3GaS+lvVfNv6TiBICKrM09K2+rQ== X-Received: by 2002:a17:90a:ad7:: with SMTP id r23mr8081945pje.184.1630068293087; Fri, 27 Aug 2021 05:44:53 -0700 (PDT) Received: from [192.168.0.196] ([146.196.34.150]) by smtp.gmail.com with ESMTPSA id e16sm4085631pfc.214.2021.08.27.05.44.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Aug 2021 05:44:52 -0700 (PDT) From: Ankur Saini Message-Id: <8DD325D5-194A-42D6-A319-C38225E09F3B@gmail.com> Content-Type: multipart/mixed; boundary="Apple-Mail=_6F6A020B-7F16-4CFA-9AB0-4E2C8E0D2F9E" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.20.0.2.21\)) Subject: Re: [PATCH] analyzer: Impose recursion limit on indirect calls. Date: Fri, 27 Aug 2021 18:14:47 +0530 In-Reply-To: <7a999e68037cf92b857b2d987ec8e82385a4d6d9.camel@redhat.com> Cc: =?utf-8?Q?Martin_Li=C5=A1ka?= , gcc Patches To: David Malcolm References: <02524C4A-6B71-44BD-90E3-E9328DCE32E7@gmail.com> <5df6e7001a5792e5aeaf03de4658cad2c4bdc6e3.camel@redhat.com> <9C51062C-3457-4345-9BDC-20F7FE4BFA1E@gmail.com> <47cb93b4727ae6e4ff0f37e22947cc72705bf580.camel@redhat.com> <6C8ACAA4-BD3A-480B-BB2D-FA7CD23E4AE0@gmail.com> <7a999e68037cf92b857b2d987ec8e82385a4d6d9.camel@redhat.com> X-Mailer: Apple Mail (2.3654.20.0.2.21) X-Spam-Status: No, score=3.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_ABUSEAT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Aug 2021 12:44:55 -0000 --Apple-Mail=_6F6A020B-7F16-4CFA-9AB0-4E2C8E0D2F9E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 While working on patch to convert most of the 8 whitespace characters to = tabs in the analyzer=E2=80=99s source, I see this weird behaviour where = at some places indentation looks weird when viewed in patch file ( = generated via =E2=80=9Cgit format-patch=E2=80=9D ) but looks alright = when viewed in text editor. Here is the current patch file, Can someone look at this and see if they = also experience the same ? --Apple-Mail=_6F6A020B-7F16-4CFA-9AB0-4E2C8E0D2F9E Content-Disposition: attachment; filename=fix.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="fix.patch" Content-Transfer-Encoding: quoted-printable =46rom=2036ce00faa492de780cbc7e2e1e440cd4dad50b2e=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Ankur=20Saini=20=0A= Date:=20Thu,=2026=20Aug=202021=2010:33:38=20+0530=0ASubject:=20[PATCH]=20= analyzer:=20whitespace=20fix=0A=0A---=0A=20gcc/analyzer/call-string.cc=20= =20=20=20=20=20=20=20|=20=20=206=20+-=0A=20= gcc/analyzer/diagnostic-manager.cc=20|=20=2062=20++++----=0A=20= gcc/analyzer/engine.cc=20=20=20=20=20=20=20=20=20=20=20=20=20|=20242=20= ++++++++++++++---------------=0A=20gcc/analyzer/exploded-graph.h=20=20=20= =20=20=20|=20=2014=20+-=0A=20gcc/analyzer/program-state.cc=20=20=20=20=20= =20|=20=2028=20++--=0A=20gcc/analyzer/region-model.cc=20=20=20=20=20=20=20= |=20=2016=20+-=0A=20gcc/analyzer/region-model.h=20=20=20=20=20=20=20=20|=20= =20=208=20+-=0A=207=20files=20changed,=20188=20insertions(+),=20188=20= deletions(-)=0A=0Adiff=20--git=20a/gcc/analyzer/call-string.cc=20= b/gcc/analyzer/call-string.cc=0Aindex=201e652a08a5a..91a01e2db20=20= 100644=0A---=20a/gcc/analyzer/call-string.cc=0A+++=20= b/gcc/analyzer/call-string.cc=0A@@=20-248,11=20+248,11=20@@=20= call_string::cmp=20(const=20call_string=20&a,=0A=20=20=20=20=20=20=20= const=20call_string::element_t=20a_node_pair=20=3D=20a[i];=0A=20=20=20=20= =20=20=20const=20call_string::element_t=20b_node_pair=20=3D=20b[i];=0A=20= =20=20=20=20=20=20int=20src_cmp=20=0A-=20=20=20=20=20=20=09=3D=20= a_node_pair.m_callee->m_index=20-=20b_node_pair.m_callee->m_index;=0A+=09= =3D=20a_node_pair.m_callee->m_index=20-=20b_node_pair.m_callee->m_index;=0A= =20=20=20=20=20=20=20if=20(src_cmp)=0A=20=09return=20src_cmp;=0A=20=20=20= =20=20=20=20int=20dest_cmp=20=0A-=20=20=20=20=20=20=09=3D=20= a_node_pair.m_caller->m_index=20-=20b_node_pair.m_caller->m_index;=0A+=09= =3D=20a_node_pair.m_caller->m_index=20-=20b_node_pair.m_caller->m_index;=0A= =20=20=20=20=20=20=20if=20(dest_cmp)=0A=20=09return=20dest_cmp;=0A=20=20=20= =20=20=20=20i++;=0A@@=20-297,7=20+297,7=20@@=20call_string::validate=20= ()=20const=0A=20=20=20=20=20if=20(i=20>=200)=0A=20=20=20=20=20{=0A=20=20=20= =20=20=20=20gcc_assert=20(e->get_caller_function=20()=20=3D=3D=20=0A-=20=20= =20=20=20=20=09=09=20=20m_elements[i=20-=201].get_callee_function=20());=0A= +=09=09=20=20m_elements[i=20-=201].get_callee_function=20());=0A=20=20=20= =20=20}=0A=20}=0A=20=0Adiff=20--git=20= a/gcc/analyzer/diagnostic-manager.cc=20= b/gcc/analyzer/diagnostic-manager.cc=0Aindex=207ffe0004356..6989f166f47=20= 100644=0A---=20a/gcc/analyzer/diagnostic-manager.cc=0A+++=20= b/gcc/analyzer/diagnostic-manager.cc=0A@@=20-2100,18=20+2100,18=20@@=20= diagnostic_manager::prune_for_sm_diagnostic=20(checker_path=20*path,=0A=20= =09=20=20=20=20callsite_expr=20expr;=0A=20=0A=20=09=20=20=20=20tree=20= caller_var;=0A-=20=20=20=20=20=20=20=20=20=20=20=20if(event->m_sedge)=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20{=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20const=20callgraph_superedge&=20cg_superedge=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=3D=20= event->get_callgraph_superedge=20();=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20if=20(cg_superedge.m_cedge)=0A-=09=20=20=20=20=20=20=20=20= =20=20caller_var=0A-=09=20=20=20=20=20=20=20=20=20=20=20=20=3D=20= cg_superedge.map_expr_from_callee_to_caller=20(callee_var,=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20&expr);=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20else=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20caller_var=20=3D=20caller_model->get_representative_tree=20= (sval);=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20}=0A-=20=20=20=20=20= =20=20=20=20=20=20=20else=0A+=09=20=20=20=20if(event->m_sedge)=0A+=09=20=20= =20=20=20=20{=0A+=09=09const=20callgraph_superedge&=20cg_superedge=0A+=09= =09=20=20=3D=20event->get_callgraph_superedge=20();=0A+=09=09if=20= (cg_superedge.m_cedge)=0A+=09=09=20=20caller_var=0A+=09=09=20=20=20=20=3D=20= cg_superedge.map_expr_from_callee_to_caller=20(callee_var,=0A+=09=09=09=09= =09=09=09=09=20=20=20&expr);=0A+=09=09else=0A+=09=09=20=20caller_var=20=3D= =20caller_model->get_representative_tree=20(sval);=0A+=09=20=20=20=20=20=20= }=0A+=09=20=20=20=20else=0A=20=09=20=20=20=20=20=20caller_var=20=3D=20= caller_model->get_representative_tree=20(sval);=0A=20=0A=20=09=20=20=20=20= if=20(caller_var)=0A@@=20-2135,27=20+2135,27=20@@=20= diagnostic_manager::prune_for_sm_diagnostic=20(checker_path=20*path,=0A=20= =09=20=20=20=20if=20(sval)=0A=20=09=20=20=20=20=20=20{=0A=20=09=09= return_event=20*event=20=3D=20(return_event=20*)base_event;=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20const=20region_model=20*caller_model=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=3D=20= event->m_eedge.m_dest->get_state=20().m_region_model;=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20tree=20caller_var=20=3D=20= caller_model->get_representative_tree=20(sval);=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20const=20region_model=20*callee_model=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=3D=20= event->m_eedge.m_src->get_state=20().m_region_model;=0A+=09=09const=20= region_model=20*caller_model=0A+=09=09=20=20=3D=20= event->m_eedge.m_dest->get_state=20().m_region_model;=0A+=09=09tree=20= caller_var=20=3D=20caller_model->get_representative_tree=20(sval);=0A+=09= =09const=20region_model=20*callee_model=0A+=09=09=20=20=3D=20= event->m_eedge.m_src->get_state=20().m_region_model;=0A=20=09=09= callsite_expr=20expr;=0A=20=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20tree=20callee_var;=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20if=20(event->m_sedge)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20{=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= const=20callgraph_superedge&=20cg_superedge=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=3D=20= event->get_callgraph_superedge=20();=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20if=20(cg_superedge.m_cedge)=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20callee_var=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=3D=20= cg_superedge.map_expr_from_caller_to_callee=20(caller_var,=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20&expr);=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20else=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20callee_var=20=3D=20= callee_model->get_representative_tree=20(sval);=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20}=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20else=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= callee_var=20=3D=20callee_model->get_representative_tree=20(sval);=0A+=09= =09tree=20callee_var;=0A+=09=09if=20(event->m_sedge)=0A+=09=09=20=20{=0A= +=09=09=20=20=20=20const=20callgraph_superedge&=20cg_superedge=0A+=09=09=20= =20=20=20=20=20=3D=20event->get_callgraph_superedge=20();=0A+=09=09=20=20= =20=20if=20(cg_superedge.m_cedge)=0A+=09=09=20=20=20=20=20=20callee_var=0A= +=09=09=09=3D=20cg_superedge.map_expr_from_caller_to_callee=20= (caller_var,=0A+=09=09=09=09=09=09=09=09=20=20=20=20=20=20=20&expr);=0A+=09= =09=20=20=20=20else=0A+=09=09=20=20=20=20=20=20callee_var=20=3D=20= callee_model->get_representative_tree=20(sval);=0A+=09=09=20=20}=0A+=09=09= else=0A+=09=09=20=20callee_var=20=3D=20= callee_model->get_representative_tree=20(sval);=0A=20=0A=20=09=09if=20= (callee_var)=0A=20=09=09=20=20{=0Adiff=20--git=20= a/gcc/analyzer/engine.cc=20b/gcc/analyzer/engine.cc=0Aindex=20= 9c604d1eb8c..2894a3f16cf=20100644=0A---=20a/gcc/analyzer/engine.cc=0A+++=20= b/gcc/analyzer/engine.cc=0A@@=20-1658,16=20+1658,16=20@@=20= dynamic_call_info_t::add_events_to_path=20(checker_path=20= *emission_path,=0A=20=0A=20=20=20if=20(m_is_returning_call)=0A=20=20=20=20= =20emission_path->add_event=20(new=20return_event=20(eedge,=20= (m_dynamic_call=0A-=09=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=09=09=09=20=20=20=20=20=20=20=20?=20m_dynamic_call->location=0A-=09= =20=20=20=20=20=20=20=20=20=20=20=09=20=20=20=09=09=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20:=20UNKNOWN_LOCATION),=0A-=09=20=20=20=20=20=20=20= =20=20=20=09=20=20=20=20=20=20dest_point.get_fndecl=20(),=0A-=09=20=20=20= =20=20=20=20=20=20=20=09=20=20=20=20=20=20dest_stack_depth));=0A+=09=09=09= =09=09=09=09?=20m_dynamic_call->location=0A+=09=09=09=09=09=09=09:=20= UNKNOWN_LOCATION),=0A+=09=09=09=20=20=20=20=20=20dest_point.get_fndecl=20= (),=0A+=09=09=09=20=20=20=20=20=20dest_stack_depth));=0A=20=20=20else=0A=20= =20=20=20=20emission_path->add_event=20(new=20call_event=20(eedge,=20= (m_dynamic_call=0A-=09=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=09=09=09=20=20=20=20=20=20?=20m_dynamic_call->location=0A-=09=20=20= =20=20=20=20=20=20=20=20=20=09=20=20=20=09=09=20=20=20=20=20=20=20=20=20=20= =20=20=20=20:=20UNKNOWN_LOCATION),=0A-=09=20=20=20=20=20=20=20=20=20=20=09= =20=20=20=20=20=20src_point.get_fndecl=20(),=0A-=09=20=20=20=20=20=20=20=20= =20=20=09=20=20=20=20=20=20src_stack_depth));=0A+=09=09=09=09=09=09=20=20= =20=20=20=20?=20m_dynamic_call->location=0A+=09=09=09=09=09=09=20=20=20=20= =20=20:=20UNKNOWN_LOCATION),=0A+=09=09=09=20=20=20=20=20=20= src_point.get_fndecl=20(),=0A+=09=09=09=20=20=20=20=20=20= src_stack_depth));=0A=20=0A=20}=0A=20=0A@@=20-3035,12=20+3035,12=20@@=20= state_change_requires_new_enode_p=20(const=20program_state=20&old_state,=0A= =20=0A=20bool=0A=20exploded_graph::maybe_create_dynamic_call=20(const=20= gcall=20*call,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= tree=20fn_decl,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= exploded_node=20*node,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20program_state=20next_state,=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20program_point=20&next_point,=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20uncertainty_t=20*uncertainty,=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20logger=20*logger)=0A+=09=09=09=09= =09=20=20=20tree=20fn_decl,=0A+=09=09=09=09=09=20=20=20exploded_node=20= *node,=0A+=09=09=09=09=09=20=20=20program_state=20next_state,=0A+=09=09=09= =09=09=20=20=20program_point=20&next_point,=0A+=09=09=09=09=09=20=20=20= uncertainty_t=20*uncertainty,=0A+=09=09=09=09=09=20=20=20logger=20= *logger)=0A=20{=0A=20=20=20LOG_FUNC=20(logger);=0A=20=0A@@=20-3053,44=20= +3053,44=20@@=20exploded_graph::maybe_create_dynamic_call=20(const=20= gcall=20*call,=0A=20=20=20=20=20=20=20supernode=20*sn_exit=20=3D=20= sg.get_node_for_function_exit=20(fun);=0A=20=0A=20=20=20=20=20=20=20= program_point=20new_point=0A-=20=20=20=20=20=20=20=20=3D=20= program_point::before_supernode=20(sn_entry,=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20NULL,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20this_point->get_call_string=20());=0A+=09=3D=20= program_point::before_supernode=20(sn_entry,=0A+=09=09=09=09=09=20=20=20= NULL,=0A+=09=09=09=09=09=20=20=20this_point->get_call_string=20());=0A=20= =0A=20=20=20=20=20=20=20new_point.push_to_call_stack=20(sn_exit,=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20next_point.get_supernode());=0A+=09=09=09=09=20= =20=20=20next_point.get_supernode());=0A=20=0A=20=20=20=20=20=20=20/*=20= Impose=20a=20maximum=20recursion=20depth=20and=20don't=20analyze=20paths=0A= -=20=20=20=20=20=20=20=20=20that=20exceed=20it=20further.=0A-=20=20=20=20= =20=20=20=20=20This=20is=20something=20of=20a=20blunt=20workaround,=20= but=20it=20only=0A-=20=20=20=20=20=20=20=20=20applies=20to=20recursion=20= (and=20mutual=20recursion),=20not=20to=0A-=20=20=20=20=20=20=20=20=20= general=20call=20stacks.=20=20*/=0A+=09=20that=20exceed=20it=20further.=0A= +=09=20This=20is=20something=20of=20a=20blunt=20workaround,=20but=20it=20= only=0A+=09=20applies=20to=20recursion=20(and=20mutual=20recursion),=20= not=20to=0A+=09=20general=20call=20stacks.=20=20*/=0A=20=20=20=20=20=20=20= if=20(new_point.get_call_string=20().calc_recursion_depth=20()=0A-=20=20=20= =20=20=20=20=20=20=20>=20param_analyzer_max_recursion_depth)=0A+=09=20=20= >=20param_analyzer_max_recursion_depth)=0A=20=20=20=20=20=20=20{=0A-=20=20= =20=20=20=20=20=20if=20(logger)=0A-=20=20=20=20=20=20=20=20=20=20= logger->log=20("rejecting=20call=20edge:=20recursion=20limit=20= exceeded");=0A-=20=20=20=20=20=20=20=20return=20false;=0A+=09if=20= (logger)=0A+=09=20=20logger->log=20("rejecting=20call=20edge:=20= recursion=20limit=20exceeded");=0A+=09return=20false;=0A=20=20=20=20=20=20= =20}=0A=20=0A=20=20=20=20=20=20=20next_state.push_call=20(*this,=20node,=20= call,=20uncertainty);=0A=20=0A=20=20=20=20=20=20=20if=20= (next_state.m_valid)=0A-=20=20=20=20=20=20=20=20{=0A-=20=20=20=20=20=20=20= =20=20=20if=20(logger)=0A-=20=20=20=20=20=20=20=20=20=20=20=20= logger->log=20("Discovered=20call=20to=20%s=20[SN:=20%i=20->=20SN:=20= %i]",=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20function_name(fun),=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20this_point->get_supernode=20= ()->m_index,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20sn_entry->m_index);=0A-=0A-=20=20=20=20=20=20=20=20=20= =20exploded_node=20*enode=20=3D=20get_or_create_node=20(new_point,=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20next_state,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20node);=0A-=20=20=20=20=20=20=20=20=20=20if=20= (enode)=0A-=20=20=20=20=20=20=20=20=20=20=20=20add_edge=20(node,enode,=20= NULL,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= new=20dynamic_call_info_t=20(call));=0A-=20=20=20=20=20=20=20=20=20=20= return=20true;=0A-=20=20=20=20=20=20=20=20}=0A+=09{=0A+=09=20=20if=20= (logger)=0A+=09=20=20=20=20logger->log=20("Discovered=20call=20to=20%s=20= [SN:=20%i=20->=20SN:=20%i]",=0A+=09=09=09=20=20function_name(fun),=0A+=09= =09=09=20=20this_point->get_supernode=20()->m_index,=0A+=09=09=09=20=20= sn_entry->m_index);=0A+=0A+=09=20=20exploded_node=20*enode=20=3D=20= get_or_create_node=20(new_point,=0A+=09=09=09=09=09=09=20=20=20=20=20= next_state,=0A+=09=09=09=09=09=09=20=20=20=20=20node);=0A+=09=20=20if=20= (enode)=0A+=09=20=20=20=20add_edge=20(node,enode,=20NULL,=0A+=09=09=20=20= =20=20=20=20new=20dynamic_call_info_t=20(call));=0A+=09=20=20return=20= true;=0A+=09}=0A=20=20=20=20=20}=0A=20=20=20return=20false;=0A=20}=0A@@=20= -3289,8=20+3289,8=20@@=20exploded_graph::process_node=20(exploded_node=20= *node)=0A=20=20=20=20=20=20=20break;=0A=20=20=20=20=20case=20= PK_AFTER_SUPERNODE:=0A=20=20=20=20=20=20=20{=0A-=20=20=20=20=20=20=20=20= bool=20found_a_superedge=20=3D=20false;=0A-=20=20=20=20=20=20=20=20bool=20= is_an_exit_block=20=3D=20false;=0A+=09bool=20found_a_superedge=20=3D=20= false;=0A+=09bool=20is_an_exit_block=20=3D=20false;=0A=20=09/*=20If=20= this=20is=20an=20EXIT=20BB,=20detect=20leaks,=20and=20potentially=0A=20=09= =20=20=20create=20a=20function=20summary.=20=20*/=0A=20=09if=20= (point.get_supernode=20()->return_p=20())=0A@@=20-3334,53=20+3334,53=20= @@=20exploded_graph::process_node=20(exploded_node=20*node)=0A=20=09=20=20= =20=20program_state=20next_state=20(state);=0A=20=09=20=20=20=20= uncertainty_t=20uncertainty;=0A=20=0A-=20=20=20=20=20=20=20=20=20=20=20=20= /*=20Make=20use=20the=20current=20state=20and=20try=20to=20discover=20= and=20analyse=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20indirect=20= function=20calls=20(a=20call=20that=20doesn't=20have=20an=20underlying=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20cgraph=20edge=20= representing=20call).=0A-=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= Some=20examples=20of=20such=20calls=20are=20virtual=20function=20calls=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20and=20calls=20that=20= happen=20via=20a=20function=20pointer.=20=20*/=0A-=20=20=20=20=20=20=20=20= =20=20=20=20if=20(succ->m_kind=20=3D=3D=20SUPEREDGE_INTRAPROCEDURAL_CALL=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=09&&=20= !(succ->get_any_callgraph_edge=20()))=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20{=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20const=20= gcall=20*call=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=3D= =20point.get_supernode=20()->get_final_call=20();=0A-=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20impl_region_model_context=20ctxt=20(*this,=0A= -=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= node,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20&state,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20&next_state,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20&uncertainty,=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20point.get_stmt());=0A-=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20region_model=20*model=20=3D=20= state.m_region_model;=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= bool=20call_discovered=20=3D=20false;=0A-=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20if=20(tree=20fn_decl=20=3D=20= model->get_fndecl_for_call(call,&ctxt))=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20call_discovered=20=3D=20= maybe_create_dynamic_call=20(call,=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20fn_decl,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20node,=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20next_state,=0A-=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20next_point,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= &uncertainty,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20logger);=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20if=20(!call_discovered)=0A-=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20{=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20/*=20An=20unknown=20function=20= or=20a=20special=20function=20was=20called=20=0A-=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20at=20this=20point,=20in=20= such=20case,=20don't=20terminate=20the=20=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20analysis=20of=20the=20current=20= function.=0A-=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20The=20analyzer=20handles=20calls=20to=20such=20functions=20= while=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20analysing=20the=20stmt=20itself,=20so=20the=20the=20function=20= call=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20must=20have=20been=20handled=20by=20the=20anlyzer=20till=20now.=20=20= */=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= exploded_node=20*next=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=3D=20get_or_create_node=20(next_point,=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20next_state,=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20node);=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20if=20(next)=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20add_edge=20= (node,=20next,=20succ);=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20}=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20}=0A+=09=20=20=20=20= /*=20Make=20use=20the=20current=20state=20and=20try=20to=20discover=20= and=20analyse=0A+=09=20=20=20=20=20=20=20indirect=20function=20calls=20= (a=20call=20that=20doesn't=20have=20an=20underlying=0A+=09=20=20=20=20=20= =20=20cgraph=20edge=20representing=20call).=0A+=0A+=09=20=20=20=20=20=20=20= Some=20examples=20of=20such=20calls=20are=20virtual=20function=20calls=0A= +=09=20=20=20=20=20=20=20and=20calls=20that=20happen=20via=20a=20= function=20pointer.=20=20*/=0A+=09=20=20=20=20if=20(succ->m_kind=20=3D=3D=20= SUPEREDGE_INTRAPROCEDURAL_CALL=0A+=09=09&&=20= !(succ->get_any_callgraph_edge=20()))=0A+=09=20=20=20=20=20=20{=0A+=09=09= const=20gcall=20*call=0A+=09=09=20=20=3D=20point.get_supernode=20= ()->get_final_call=20();=0A+=0A+=09=09impl_region_model_context=20ctxt=20= (*this,=0A+=09=09=09=09=09=09node,=0A+=09=09=09=09=09=09&state,=0A+=09=09= =09=09=09=09&next_state,=0A+=09=09=09=09=09=09&uncertainty,=0A+=09=09=09=09= =09=09point.get_stmt());=0A+=0A+=09=09region_model=20*model=20=3D=20= state.m_region_model;=0A+=09=09bool=20call_discovered=20=3D=20false;=0A+=0A= +=09=09if=20(tree=20fn_decl=20=3D=20= model->get_fndecl_for_call(call,&ctxt))=0A+=09=09=20=20call_discovered=20= =3D=20maybe_create_dynamic_call=20(call,=0A+=09=09=09=09=09=09=09=20=20=20= =20=20=20=20fn_decl,=0A+=09=09=09=09=09=09=09=20=20=20=20=20=20=20node,=0A= +=09=09=09=09=09=09=09=20=20=20=20=20=20=20next_state,=0A+=09=09=09=09=09= =09=09=20=20=20=20=20=20=20next_point,=0A+=09=09=09=09=09=09=09=20=20=20=20= =20=20=20&uncertainty,=0A+=09=09=09=09=09=09=09=20=20=20=20=20=20=20= logger);=0A+=09=09if=20(!call_discovered)=0A+=09=09=20=20{=0A+=09=09=20=20= =20=20=20/*=20An=20unknown=20function=20or=20a=20special=20function=20= was=20called=0A+=09=09=09at=20this=20point,=20in=20such=20case,=20don't=20= terminate=20the=0A+=09=09=09analysis=20of=20the=20current=20function.=0A= +=0A+=09=09=09The=20analyzer=20handles=20calls=20to=20such=20functions=20= while=0A+=09=09=09analysing=20the=20stmt=20itself,=20so=20the=20the=20= function=20call=0A+=09=09=09must=20have=20been=20handled=20by=20the=20= anlyzer=20till=20now.=20=20*/=0A+=09=09=20=20=20=20=20exploded_node=20= *next=0A+=09=09=20=20=20=20=20=20=20=3D=20get_or_create_node=20= (next_point,=0A+=09=09=09=09=09=20=20=20=20=20next_state,=0A+=09=09=09=09= =09=20=20=20=20=20node);=0A+=09=09=20=20=20=20=20if=20(next)=0A+=09=09=20= =20=20=20=20=20=20add_edge=20(node,=20next,=20succ);=0A+=09=09=20=20}=0A= +=09=20=20=20=20=20=20}=0A=20=0A=20=09=20=20=20=20if=20(!node->on_edge=20= (*this,=20succ,=20&next_point,=20&next_state,=0A=20=09=09=09=09= &uncertainty))=0A@@=20-3396,37=20+3396,37=20@@=20= exploded_graph::process_node=20(exploded_node=20*node)=0A=20=09=20=20=20=20= =20=20add_edge=20(node,=20next,=20succ);=0A=20=09=20=20}=0A=20=0A-=20=20=20= =20=20=20=20=20/*=20Return=20from=20the=20calls=20which=20doesn't=20have=20= a=20return=20superedge.=0A-=20=20=20=20=09=20=20=20Such=20case=20occurs=20= when=20GCC's=20middle=20end=20didn't=20knew=20which=20function=20to=0A-=20= =20=20=20=09=20=20=20call=20but=20analyzer=20did.=20=20*/=0A-=20=20=20=20= =20=20=20=20if((is_an_exit_block=20&&=20!found_a_superedge)=0A-=20=20=20=20= =20=20=20=20=20=20=20&&=20(!point.get_call_string=20().empty_p=20()))=0A= -=20=20=20=20=20=20=20=20=20=20{=0A-=20=20=20=20=20=20=20=20=20=20=20=20= const=20call_string=20cs=20=3D=20point.get_call_string=20();=0A-=20=20=20= =20=20=20=20=20=20=20=20=20program_point=20next_point=0A-=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=3D=20program_point::before_supernode=20= (cs.get_caller_node=20(),=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20NULL,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20cs);=0A-=20=20=20=20=20=20=20=20=20=20=20= =20program_state=20next_state=20(state);=0A-=20=20=20=20=20=20=20=20=20=20= =20=20uncertainty_t=20uncertainty;=0A-=0A-=20=20=20=20=20=20=20=20=20=20=20= =20const=20gcall=20*call=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=3D=20= next_point.get_supernode=20()->get_returning_call=20();=0A-=0A-=20=20=20=20= =20=20=20=20=20=20=20=20if(call)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20= =20next_state.returning_call=20(*this,=20node,=20call,=20&uncertainty);=0A= -=0A-=20=20=20=20=20=20=20=20=20=20=20=20if=20(next_state.m_valid)=0A-=20= =20=20=20=20=20=20=20=20=20=20=20=20=20{=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20next_point.pop_from_call_stack=20();=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20exploded_node=20*enode=20=3D=20= get_or_create_node=20(next_point,=0A-=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= next_state,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20node);=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20if=20(enode)=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20add_edge=20(node,=20enode,=20NULL,=0A-=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= new=20dynamic_call_info_t=20(call,=20true));=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20}=0A-=20=20=20=20=20=20=20=20=20=20}=0A+=09/*=20Return=20= from=20the=20calls=20which=20doesn't=20have=20a=20return=20superedge.=0A= +=09=20=20=20Such=20case=20occurs=20when=20GCC's=20middle=20end=20didn't=20= knew=20which=20function=20to=0A+=09=20=20=20call=20but=20analyzer=20did.=20= =20*/=0A+=09if((is_an_exit_block=20&&=20!found_a_superedge)=0A+=09=20=20=20= &&=20(!point.get_call_string=20().empty_p=20()))=0A+=09=20=20{=0A+=09=20=20= =20=20const=20call_string=20cs=20=3D=20point.get_call_string=20();=0A+=09= =20=20=20=20program_point=20next_point=0A+=09=20=20=20=20=20=20=3D=20= program_point::before_supernode=20(cs.get_caller_node=20(),=0A+=09=09=09=09= =09=09=20NULL,=0A+=09=09=09=09=09=09=20cs);=0A+=09=20=20=20=20= program_state=20next_state=20(state);=0A+=09=20=20=20=20uncertainty_t=20= uncertainty;=0A+=0A+=09=20=20=20=20const=20gcall=20*call=0A+=09=20=20=20=20= =20=20=3D=20next_point.get_supernode=20()->get_returning_call=20();=0A+=0A= +=09=20=20=20=20if(call)=0A+=09=20=20=20=20=20=20= next_state.returning_call=20(*this,=20node,=20call,=20&uncertainty);=0A+=0A= +=09=20=20=20=20if=20(next_state.m_valid)=0A+=09=20=20=20=20=20=20{=0A+=09= =09next_point.pop_from_call_stack=20();=0A+=09=09exploded_node=20*enode=20= =3D=20get_or_create_node=20(next_point,=0A+=09=09=09=09=09=09=09=20=20=20= next_state,=0A+=09=09=09=09=09=09=09=20=20=20node);=0A+=09=09if=20= (enode)=0A+=09=09=20=20add_edge=20(node,=20enode,=20NULL,=0A+=09=09=09=20= =20=20=20new=20dynamic_call_info_t=20(call,=20true));=0A+=09=20=20=20=20=20= =20}=0A+=09=20=20}=0A=20=20=20=20=20=20=20}=0A=20=20=20=20=20=20=20= break;=0A=20=20=20=20=20}=0Adiff=20--git=20= a/gcc/analyzer/exploded-graph.h=20b/gcc/analyzer/exploded-graph.h=0A= index=206890e84f985..b27de80c6d0=20100644=0A---=20= a/gcc/analyzer/exploded-graph.h=0A+++=20b/gcc/analyzer/exploded-graph.h=0A= @@=20-369,7=20+369,7=20@@=20class=20dynamic_call_info_t=20:=20public=20= exploded_edge::custom_info_t=0A=20{=0A=20public:=0A=20=20=20= dynamic_call_info_t=20(const=20gcall=20*dynamic_call,=0A-=20=20=09=09=20=20= =20=20=20=20=20const=20bool=20is_returning_call=20=3D=20false)=0A+=09=09=20= =20=20=20=20=20=20const=20bool=20is_returning_call=20=3D=20false)=0A=20=20= =20:=20m_dynamic_call=20(dynamic_call),=20=0A=20=20=20=20=20= m_is_returning_call=20(is_returning_call)=0A=20=20=20{}=0A@@=20-817,12=20= +817,12=20@@=20public:=0A=20=20=20void=20process_node=20(exploded_node=20= *node);=0A=20=0A=20=20=20bool=20maybe_create_dynamic_call=20(const=20= gcall=20*call,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20tree=20fn_decl,=0A-=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20exploded_node=20*node,=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= program_state=20next_state,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= program_point=20&next_point,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= uncertainty_t=20*uncertainty,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20logger=20= *logger);=0A+=09=09=09=09=20=20tree=20fn_decl,=0A+=09=09=09=09=20=20= exploded_node=20*node,=0A+=09=09=09=09=20=20program_state=20next_state,=0A= +=09=09=09=09=20=20program_point=20&next_point,=0A+=09=09=09=09=20=20= uncertainty_t=20*uncertainty,=0A+=09=09=09=09=20=20logger=20*logger);=0A=20= =0A=20=20=20exploded_node=20*get_or_create_node=20(const=20program_point=20= &point,=0A=20=09=09=09=09=20=20=20=20=20const=20program_state=20&state,=0A= diff=20--git=20a/gcc/analyzer/program-state.cc=20= b/gcc/analyzer/program-state.cc=0Aindex=20ea53c61f497..5e100d48d9f=20= 100644=0A---=20a/gcc/analyzer/program-state.cc=0A+++=20= b/gcc/analyzer/program-state.cc=0A@@=20-1040,19=20+1040,19=20@@=20= program_state::on_edge=20(exploded_graph=20&eg,=0A=20=20=20=20the=20call=20= (=20like=20call=20via=20a=20function=20pointer=20)=20=20*/=0A=20void=0A=20= program_state::push_call=20(exploded_graph=20&eg,=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20exploded_node=20= *enode,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20const=20gcall=20*call_stmt,=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20uncertainty_t=20= *uncertainty)=0A+=09=09=09=20=20exploded_node=20*enode,=0A+=09=09=09=20=20= const=20gcall=20*call_stmt,=0A+=09=09=09=20=20uncertainty_t=20= *uncertainty)=0A=20{=0A=20=20=20/*=20Update=20state.=20=20*/=0A=20=20=20= const=20program_point=20&point=20=3D=20enode->get_point=20();=0A=20=20=20= const=20gimple=20*last_stmt=20=3D=20point.get_supernode=20= ()->get_last_stmt=20();=0A=20=0A=20=20=20impl_region_model_context=20= ctxt=20(eg,=20enode,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20&enode->get_state=20= (),=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20this,=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= uncertainty,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20last_stmt);=0A+=09=09=09=09=20= =20&enode->get_state=20(),=0A+=09=09=09=09=20=20this,=0A+=09=09=09=09=20=20= uncertainty,=0A+=09=09=09=09=20=20last_stmt);=0A=20=20=20= m_region_model->update_for_gcall=20(call_stmt,=20&ctxt);=0A=20}=0A=20=0A= @@=20-1062,19=20+1062,19=20@@=20program_state::push_call=20= (exploded_graph=20&eg,=0A=20=20=20=20the=20return=20*/=0A=20void=0A=20= program_state::returning_call=20(exploded_graph=20&eg,=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20exploded_node=20*enode,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20const=20gcall=20= *call_stmt,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20uncertainty_t=20*uncertainty)=0A+=09=09=09= =20=20=20=20=20=20=20exploded_node=20*enode,=0A+=09=09=09=20=20=20=20=20=20= =20const=20gcall=20*call_stmt,=0A+=09=09=09=20=20=20=20=20=20=20= uncertainty_t=20*uncertainty)=0A=20{=0A=20=20=20/*=20Update=20state.=20=20= */=0A=20=20=20const=20program_point=20&point=20=3D=20enode->get_point=20= ();=0A=20=20=20const=20gimple=20*last_stmt=20=3D=20point.get_supernode=20= ()->get_last_stmt=20();=0A=20=0A=20=20=20impl_region_model_context=20= ctxt=20(eg,=20enode,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20&enode->get_state=20= (),=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20this,=0A-=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= uncertainty,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20last_stmt);=0A+=09=09=09=09=20= =20&enode->get_state=20(),=0A+=09=09=09=09=20=20this,=0A+=09=09=09=09=20=20= uncertainty,=0A+=09=09=09=09=20=20last_stmt);=0A=20=20=20= m_region_model->update_for_return_gcall=20(call_stmt,=20&ctxt);=0A=20}=0A= =20=0Adiff=20--git=20a/gcc/analyzer/region-model.cc=20= b/gcc/analyzer/region-model.cc=0Aindex=20787f2ed33c0..8bbd52f9bff=20= 100644=0A---=20a/gcc/analyzer/region-model.cc=0A+++=20= b/gcc/analyzer/region-model.cc=0A@@=20-1843,8=20+1843,8=20@@=20= region_model::get_rvalue_1=20(path_var=20pv,=20region_model_context=20= *ctxt)=20const=0A=20=20=20=20=20=20=20}=0A=20=20=20=20=20case=20= OBJ_TYPE_REF:=0A=20=20=20=20=20=20=20{=0A-=20=20=20=20=20=20=20=20tree=20= expr=20=3D=20OBJ_TYPE_REF_EXPR=20(pv.m_tree);=0A-=20=20=20=20=20=20=20=20= return=20get_rvalue=20(expr,=20ctxt);=0A+=09tree=20expr=20=3D=20= OBJ_TYPE_REF_EXPR=20(pv.m_tree);=0A+=09return=20get_rvalue=20(expr,=20= ctxt);=0A=20=20=20=20=20=20=20}=0A=20=20=20=20=20}=0A=20}=0A@@=20= -3232,11=20+3232,11=20@@=20region_model::update_for_return_gcall=20= (const=20gcall=20*call_stmt,=0A=20=20=20if=20(lhs)=0A=20=20=20=20=20{=0A=20= =20=20=20=20=20=20/*=20Normally=20we=20access=20the=20top-level=20frame,=20= which=20is:=0A-=20=20=20=20=20=20=20=20=20path_var=20(expr,=20= get_stack_depth=20()=20-=201)=0A-=20=20=20=20=20=20=20=20=20whereas=20= here=20we=20need=20the=20caller=20frame,=20hence=20"-=202"=20here.=20=20= */=0A+=09=20path_var=20(expr,=20get_stack_depth=20()=20-=201)=0A+=09=20= whereas=20here=20we=20need=20the=20caller=20frame,=20hence=20"-=202"=20= here.=20=20*/=0A=20=20=20=20=20=20=20gcc_assert=20(get_stack_depth=20()=20= >=3D=202);=0A=20=20=20=20=20=20=20result_dst_reg=20=3D=20get_lvalue=20= (path_var=20(lhs,=20get_stack_depth=20()=20-=202),=0A-=20=20=20=20=20=20=20= =20=20=20=20=09=09=09=20=20=20ctxt);=0A+=09=09=09=09=20=20=20ctxt);=0A=20= =20=20=20=20}=0A=20=0A=20=20=20pop_frame=20(result_dst_reg,=20NULL,=20= ctxt);=0A@@=20-5368,10=20+5368,10=20@@=20test_widening_constraints=20()=0A= =20=20=20=20=20=20=20=20{i_23:=20(WIDENED=20(at=20phi,=200,=201)=20+=20= 1);=20WIDENED=20<=3D=20255}=0A=20=20=20=20=20=20i_11=20=3D=20PHI();=20= merge=20with=20state=20at=20phi=20above=0A=20=20=20=20=20=20=20=20{i_11:=20= WIDENED=20(at=20phi,=200,=201);=20WIDENED=20<=3D=20256}=0A-=20=20=20=20=20= =20=20=20=20[changing=20meaning=20of=20"WIDENED"=20here]=0A+=09=20= [changing=20meaning=20of=20"WIDENED"=20here]=0A=20=20=20=20=20=20if=20= (i_11=20<=3D=20255)=0A-=20=20=20=20=20=20=20=20T:=20{i_11:=20WIDENED=20= (at=20phi,=200,=201);=20WIDENED=20<=3D=20255};=20cache=20hit=0A-=20=20=20= =20=20=20=20=20F:=20{i_11:=20256}=0A+=09T:=20{i_11:=20WIDENED=20(at=20= phi,=200,=201);=20WIDENED=20<=3D=20255};=20cache=20hit=0A+=09F:=20{i_11:=20= 256}=0A=20=20*/=0A=20=0A=20static=20void=0Adiff=20--git=20= a/gcc/analyzer/region-model.h=20b/gcc/analyzer/region-model.h=0Aindex=20= f2c82b0dd80..06f14e5a983=20100644=0A---=20a/gcc/analyzer/region-model.h=0A= +++=20b/gcc/analyzer/region-model.h=0A@@=20-614,11=20+614,11=20@@=20= class=20region_model=0A=20=09=09=09=20=20=20=20=20=20rejected_constraint=20= **out);=0A=20=0A=20=20=20void=20update_for_gcall=20(const=20gcall=20= *call_stmt,=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20region_model_context=20*ctxt,=0A-=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20function=20*callee=20=3D=20= NULL);=0A-=20=20=0A+=09=09=09=20region_model_context=20*ctxt,=0A+=09=09=09= =20function=20*callee=20=3D=20NULL);=0A+=0A=20=20=20void=20= update_for_return_gcall=20(const=20gcall=20*call_stmt,=0A-=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20region_model_context=20*ctxt);=0A+=09=09=09=09region_model_context=20= *ctxt);=0A=20=0A=20=20=20const=20region=20*push_frame=20(function=20= *fun,=20const=20vec=20*arg_sids,=0A=20=09=09=09=20=20= =20=20region_model_context=20*ctxt);=0A--=20=0A2.32.0=0A=0A= --Apple-Mail=_6F6A020B-7F16-4CFA-9AB0-4E2C8E0D2F9E--