[analyzer] pr37802: Fix symbolic-pointer-to-boolean casts during load.
authorArtem Dergachev <artem.dergachev@gmail.com>
Tue, 17 Jul 2018 00:42:35 +0000 (00:42 +0000)
committerArtem Dergachev <artem.dergachev@gmail.com>
Tue, 17 Jul 2018 00:42:35 +0000 (00:42 +0000)
commit35dbd0b1ff4b9c26a51fa8ae178f8799f3976f67
tree40a3cb97f0d5c15d29744a46dce0cdb354b0c58a
parentd1163790c363bb47c4b072dc679522941ebf55ca
[analyzer] pr37802: Fix symbolic-pointer-to-boolean casts during load.

The canonical representation of pointer &SymRegion{$x} casted to boolean is
"$x != 0", not "$x". Assertion added in r337227 catches that.

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

llvm-svn: 337228
clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
clang/test/Analysis/casts.cpp
clang/test/Analysis/pr37802.cpp [new file with mode: 0644]