]> granicus.if.org Git - clang/commit
[analyzer] Add LocationContext information to SymbolMetadata.
authorArtem Dergachev <artem.dergachev@gmail.com>
Wed, 17 Aug 2016 15:37:52 +0000 (15:37 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Wed, 17 Aug 2016 15:37:52 +0000 (15:37 +0000)
commit64f71c6f302b323f1d9bf3a8758599d28f75bf5a
treea9085519782ab07e2d1c38fa0d57e396b6a271e2
parent70e216b530344da3d450434455198f28aee852b0
[analyzer] Add LocationContext information to SymbolMetadata.

Like SymbolConjured, SymbolMetadata also needs to be uniquely
identified by the moment of its birth.

Such moments are coded by the (Statement, LocationContext, Block count) triples.
Each such triple represents the moment of analyzing a statement with a certain
call backtrace, with corresponding CFG block having been entered a given amount
of times during analysis of the current code body.

The LocationContext information was accidentally omitted for SymbolMetadata,
which leads to reincarnation of SymbolMetadata upon re-entering a code body
with a different backtrace; the new symbol is incorrectly unified with
the old symbol, which leads to unsound assumptions.

Patch by Alexey Sidorin!

Differential Revision: https://reviews.llvm.org/D21978

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278937 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h
include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
lib/StaticAnalyzer/Checkers/CStringChecker.cpp
lib/StaticAnalyzer/Core/SValBuilder.cpp
lib/StaticAnalyzer/Core/SymbolManager.cpp
test/Analysis/string.c