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>