aboutsummaryrefslogtreecommitdiff
path: root/Analysis/ValueState.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-02-07 05:48:01 +0000
committerTed Kremenek <kremenek@apple.com>2008-02-07 05:48:01 +0000
commitd131c4ff6133c691f91d8a82e7197d97b187425f (patch)
tree863780b9ea0e0de126639705a30147aa1ec611a1 /Analysis/ValueState.cpp
parent64ec0cc2df70d1a890156379e25a18e3f1bf9ff1 (diff)
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
Diffstat (limited to 'Analysis/ValueState.cpp')
-rw-r--r--Analysis/ValueState.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/Analysis/ValueState.cpp b/Analysis/ValueState.cpp
index b5a5985c44..20112c8ead 100644
--- a/Analysis/ValueState.cpp
+++ b/Analysis/ValueState.cpp
@@ -33,7 +33,8 @@ const llvm::APSInt* ValueState::getSymVal(SymbolID sym) const {
-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 @@ RValue ValueStateManager::GetValue(const StateTy& St, const LValue& LV) {
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;