diff options
author | David Malcolm <dmalcolm@redhat.com> | 2022-11-07 21:52:30 -0500 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2022-11-07 21:52:30 -0500 |
commit | 55e042407ef307764cb9d5a4a06954518e2112b4 (patch) | |
tree | fecc03105e1383aaa8137ac98dbcc2d397b2da01 /libcpp | |
parent | 8d0326943ee4eb87309faca28ee0ed13346dd70a (diff) | |
download | gcc-55e042407ef307764cb9d5a4a06954518e2112b4.zip gcc-55e042407ef307764cb9d5a4a06954518e2112b4.tar.gz gcc-55e042407ef307764cb9d5a4a06954518e2112b4.tar.bz2 |
analyzer: fix "when 'strchr' returns non-NULL" message
Tweak analyzer handling of strchr, so that we show the
when 'strchr' returns non-NULL
message for that execution path.
gcc/analyzer/ChangeLog:
* region-model-impl-calls.cc (region_model::impl_call_strchr):
Move to on_call_post. Handle both outcomes using bifurcation,
rather than just the "not found" case.
* region-model.cc (region_model::on_call_pre): Move
BUILT_IN_STRCHR and "strchr" to...
(region_model::on_call_post): ...here.
gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/strchr-1.c (test_literal): Detect writing to a
string literal. Verify that we emit the "when '__builtin_strchr'
returns non-NULL" message.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions