]> granicus.if.org Git - clang/commit
[analyzer] trackNullOrUndefValue: track last store to non-variables.
authorArtem Dergachev <artem.dergachev@gmail.com>
Wed, 20 Dec 2017 00:47:17 +0000 (00:47 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Wed, 20 Dec 2017 00:47:17 +0000 (00:47 +0000)
commit4c0ff5f25cab59ee047824f9aed05fcea9d7e1b2
treef81e214f4902d001e23ca5c894317b64a0e2f18a
parent6553e96647317f5e4e87f03258b74e44aa6937fe
[analyzer] trackNullOrUndefValue: track last store to non-variables.

When reporting certain kinds of analyzer warnings, we use the
bugreporter::trackNullOrUndefValue mechanism, which is part of public checker
API, to understand where a zero, null-pointer, or garbage value came from,
which would highlight important events with respect to that value in the
diagnostic path notes, and help us suppress various false positives that result
from values appearing from particular sources.

Previously, we've lost track of the value when it was written into a memory
region that is not a plain variable. Now try to resume tracking in this
situation by finding where the last write to this region has occured.

Differential revision: https://reviews.llvm.org/D41253

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321130 91177308-0d34-0410-b5e6-96231b3b80d8
lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
test/Analysis/inlining/inline-defensive-checks.c
test/Analysis/nullptr.cpp