From d8cde6f9c223f1b6d4f4e4e07088f08a629b7c2a Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Mon, 17 Feb 2020 03:06:14 -0500 Subject: analyzer: fix ICE on function pointer casts [PR 93775] PR analyzer/93775 reports an ICE in cgraph_node::get when -fanalyzer is used on code that calls a function pointer that was generated via a cast from a non-function. This patch fixes it by bulletproofing region_model::get_fndecl_for_call for the case where the code_region's get_tree_for_child_region returns NULL. gcc/analyzer/ChangeLog: PR analyzer/93775 * region-model.cc (region_model::get_fndecl_for_call): Handle the case where the code_region's get_tree_for_child_region returns NULL. gcc/testsuite/ChangeLog: PR analyzer/93775 * gcc.dg/analyzer/20020129-1.c: New test. --- gcc/analyzer/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/analyzer/ChangeLog') diff --git a/gcc/analyzer/ChangeLog b/gcc/analyzer/ChangeLog index d669c98..f9fd80c 100644 --- a/gcc/analyzer/ChangeLog +++ b/gcc/analyzer/ChangeLog @@ -1,5 +1,12 @@ 2020-02-17 David Malcolm + PR analyzer/93775 + * region-model.cc (region_model::get_fndecl_for_call): Handle the + case where the code_region's get_tree_for_child_region returns + NULL. + +2020-02-17 David Malcolm + PR analyzer/93388 * engine.cc (impl_region_model_context::on_unknown_tree_code): New. -- cgit v1.1