[analyzer] Fix dead store checker false positive
authorValeriy Savchenko <vsavchenko@apple.com>
Wed, 24 Mar 2021 13:50:19 +0000 (16:50 +0300)
committerValeriy Savchenko <vsavchenko@apple.com>
Thu, 8 Apr 2021 13:12:42 +0000 (16:12 +0300)
commit9f0d8bac144c8eb1ca4aff823b2e2d5a0f990072
tree57d56baf3f2266bde893bf1b83a8ec21eb4d3564
parentb785e03612d76145c58cb31b6fd6911a5e41e8e3
[analyzer] Fix dead store checker false positive

It is common to zero-initialize not only scalar variables,
but also structs.  This is also defensive programming and
we shouldn't complain about that.

rdar://34122265

Differential Revision: https://reviews.llvm.org/D99262
clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp
clang/test/Analysis/dead-stores.c