Added recording of "implicit" NULL dereferences of symbolic pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46843 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/ValueState.cpp b/Analysis/ValueState.cpp
index b5a5985..20112c8 100644
--- a/Analysis/ValueState.cpp
+++ b/Analysis/ValueState.cpp
@@ -33,7 +33,8 @@
-RValue ValueStateManager::GetValue(const StateTy& St, const LValue& LV) {
+RValue ValueStateManager::GetValue(const StateTy& St, const LValue& LV,
+ QualType* T) {
if (isa<InvalidValue>(LV))
return InvalidValue();
@@ -44,6 +45,19 @@
return T ? T->getValue().second : InvalidValue();
}
+
+ // FIXME: We should bind how far a "ContentsOf" will go...
+
+ case lval::SymbolValKind: {
+ const lval::SymbolVal& SV = cast<lval::SymbolVal>(LV);
+ assert (T);
+
+ if (T->getTypePtr()->isPointerType())
+ return lval::SymbolVal(SymMgr.getContentsOfSymbol(SV.getSymbol()));
+ else
+ return nonlval::SymbolVal(SymMgr.getContentsOfSymbol(SV.getSymbol()));
+ }
+
default:
assert (false && "Invalid LValue.");
break;