[cfe-commits] r55494 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRCoreEngine.h include/clang/Analysis/PathSensitive/GRExprEngine.h lib/Analysis/GRExprEngine.cpp
Ted Kremenek
kremenek at apple.com
Thu Aug 28 11:43:46 PDT 2008
Author: kremenek
Date: Thu Aug 28 13:43:46 2008
New Revision: 55494
URL: http://llvm.org/viewvc/llvm-project?rev=55494&view=rev
Log:
Fixed analyzer caching bug involving the transfer function for loads.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h
cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
cfe/trunk/lib/Analysis/GRExprEngine.cpp
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h?rev=55494&r1=55493&r2=55494&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRCoreEngine.h Thu Aug 28 13:43:46 2008
@@ -230,7 +230,8 @@
}
NodeTy* MakeNode(ExplodedNodeSet<StateTy>& Dst, Stmt* S,
- NodeTy* Pred, const StateTy* St) {
+ NodeTy* Pred, const StateTy* St,
+ ProgramPoint::Kind K = ProgramPoint::PostStmtKind) {
const StateTy* PredState = GetState(Pred);
@@ -240,7 +241,7 @@
return NULL;
}
- NodeTy* N = generateNode(S, St, Pred);
+ NodeTy* N = generateNode(S, St, Pred, K);
if (N) {
if (BuildSinks)
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h?rev=55494&r1=55493&r2=55494&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h Thu Aug 28 13:43:46 2008
@@ -442,9 +442,10 @@
return StateMgr.Assume(St, Cond, Assumption, isFeasible);
}
- NodeTy* MakeNode(NodeSet& Dst, Stmt* S, NodeTy* Pred, const GRState* St) {
+ NodeTy* MakeNode(NodeSet& Dst, Stmt* S, NodeTy* Pred, const GRState* St,
+ ProgramPoint::Kind K = ProgramPoint::PostStmtKind) {
assert (Builder && "GRStmtNodeBuilder not present.");
- return Builder->MakeNode(Dst, S, Pred, St);
+ return Builder->MakeNode(Dst, S, Pred, St, K);
}
/// Visit - Transfer function logic for all statements. Dispatches to
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=55494&r1=55493&r2=55494&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Thu Aug 28 13:43:46 2008
@@ -954,22 +954,23 @@
return;
// Proceed with the load.
+ ProgramPoint::Kind K = ProgramPoint::PostLoadKind;
// FIXME: Currently symbolic analysis "generates" new symbols
// for the contents of values. We need a better approach.
// FIXME: The "CheckOnly" option exists only because Array and Field
// loads aren't fully implemented. Eventually this option will go away.
-
+
if (CheckOnly)
- MakeNode(Dst, Ex, Pred, St);
+ MakeNode(Dst, Ex, Pred, St, K);
else if (location.isUnknown()) {
// This is important. We must nuke the old binding.
- MakeNode(Dst, Ex, Pred, SetRVal(St, Ex, UnknownVal()));
+ MakeNode(Dst, Ex, Pred, SetRVal(St, Ex, UnknownVal()), K);
}
else
MakeNode(Dst, Ex, Pred, SetRVal(St, Ex, GetRVal(St, cast<LVal>(location),
- Ex->getType())));
+ Ex->getType())), K);
}
const GRState* GRExprEngine::EvalLocation(Expr* Ex, NodeTy* Pred,
More information about the cfe-commits
mailing list