analyzer: fix false leak diagnostic on offsets from malloc [PR97608]
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 29 Oct 2020 00:10:39 +0000 (20:10 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Thu, 29 Oct 2020 00:10:39 +0000 (20:10 -0400)
commit1a9af271275f4893e28c789c8f1964025694eda1
tree6f4b335ee28124f590e65d2ea4888bf93bc5919c
parente9751143e237b507a81234a573a200ea45e7111a
analyzer: fix false leak diagnostic on offsets from malloc [PR97608]

gcc/analyzer/ChangeLog:
PR analyzer/97608
* region-model-reachability.cc (reachable_regions::handle_sval):
Operands of reachable reversible operations are reachable.

gcc/testsuite/ChangeLog:
PR analyzer/97608
* gcc.dg/analyzer/malloc-1.c (test_42d): New.
* gcc.dg/analyzer/pr97608.c: New test.
gcc/analyzer/region-model-reachability.cc
gcc/testsuite/gcc.dg/analyzer/malloc-1.c
gcc/testsuite/gcc.dg/analyzer/pr97608.c [new file with mode: 0644]