[cfe-commits] r54716 - in /cfe/trunk/lib/Analysis: GRExprEngine.cpp SymbolManager.cpp
Ted Kremenek
kremenek at apple.com
Tue Aug 12 20:28:08 PDT 2008
Author: kremenek
Date: Tue Aug 12 22:28:04 2008
New Revision: 54716
URL: http://llvm.org/viewvc/llvm-project?rev=54716&view=rev
Log:
Initialize tracked local variables to undefined.
Modified:
cfe/trunk/lib/Analysis/GRExprEngine.cpp
cfe/trunk/lib/Analysis/SymbolManager.cpp
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=54716&r1=54715&r2=54716&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Tue Aug 12 22:28:04 2008
@@ -202,10 +202,15 @@
ScopedDecl *SD = const_cast<ScopedDecl*>(I->first);
if (VarDecl* VD = dyn_cast<VarDecl>(SD)) {
- if (VD->hasGlobalStorage() || isa<ParmVarDecl>(VD)) {
- RVal X = RVal::GetSymbolValue(SymMgr, VD);
- StateMgr.SetRVal(StateImpl, lval::DeclVal(VD), X);
- }
+ // Initialize globals and parameters to symbolic values.
+ // Initialize local variables to undefined.
+ RVal X = (VD->hasGlobalStorage() || isa<ParmVarDecl>(VD) ||
+ isa<ImplicitParamDecl>(VD))
+ ? RVal::GetSymbolValue(SymMgr, VD)
+ : UndefinedVal();
+
+ StateMgr.SetRVal(StateImpl, lval::DeclVal(VD), X);
+
} else if (ImplicitParamDecl *IPD = dyn_cast<ImplicitParamDecl>(SD)) {
RVal X = RVal::GetSymbolValue(SymMgr, IPD);
StateMgr.SetRVal(StateImpl, lval::DeclVal(IPD), X);
Modified: cfe/trunk/lib/Analysis/SymbolManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/SymbolManager.cpp?rev=54716&r1=54715&r2=54716&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/SymbolManager.cpp (original)
+++ cfe/trunk/lib/Analysis/SymbolManager.cpp Tue Aug 12 22:28:04 2008
@@ -18,7 +18,8 @@
SymbolID SymbolManager::getSymbol(VarDecl* D) {
- assert (isa<ParmVarDecl>(D) || D->hasGlobalStorage());
+ assert (isa<ParmVarDecl>(D) || isa<ImplicitParamDecl>(D) ||
+ D->hasGlobalStorage());
llvm::FoldingSetNodeID profile;
More information about the cfe-commits
mailing list