aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2021-02-22 18:46:05 -0500
committerDavid Malcolm <dmalcolm@redhat.com>2021-02-22 18:46:05 -0500
commit5ee4ba031dd9fc60bf2494ca30f46c0acaa34805 (patch)
treea8f78d8b5ba74d0c16c5f5655244220ac862dd89 /libgcc
parent609204abb889166c17a600121ba8ced18db2567a (diff)
downloadgcc-5ee4ba031dd9fc60bf2494ca30f46c0acaa34805.zip
gcc-5ee4ba031dd9fc60bf2494ca30f46c0acaa34805.tar.gz
gcc-5ee4ba031dd9fc60bf2494ca30f46c0acaa34805.tar.bz2
analyzer: handle error/error_at_line [PR99196]
PR analyzer/99196 describes a false positive from -fanalyzer due to the analyzer not "knowing" that calls to GNU libc's error(3) with a nonzero status terminate the process and thus don't return. This patch fixes the false positive by special-casing "error" and "error_at_line". gcc/analyzer/ChangeLog: PR analyzer/99196 * engine.cc (exploded_node::on_stmt): Provide terminate_path flag as a way for on_call_pre to terminate the current analysis path. * region-model-impl-calls.cc (call_details::num_args): New. (region_model::impl_call_error): New. * region-model.cc (region_model::on_call_pre): Add param "out_terminate_path". Handle "error" and "error_at_line". * region-model.h (call_details::num_args): New decl. (region_model::on_call_pre): Add param "out_terminate_path". (region_model::impl_call_error): New decl. gcc/testsuite/ChangeLog: PR analyzer/99196 * gcc.dg/analyzer/error-1.c: New test. * gcc.dg/analyzer/error-2.c: New test. * gcc.dg/analyzer/error-3.c: New test.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions