[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
diff --git a/clang/test/Analysis/casts.cpp b/clang/test/Analysis/casts.cpp
index 6499b20..757eb6d 100644
--- a/clang/test/Analysis/casts.cpp
+++ b/clang/test/Analysis/casts.cpp
@@ -35,3 +35,9 @@
bool testCastToIntPtrRValueRef(char *p, int *s) {
return castToIntPtrRValueRef(p) != s; // no-crash
}
+
+bool retrievePointerFromBoolean(int *p) {
+ bool q;
+ *reinterpret_cast<int **>(&q) = p;
+ return q;
+}