[cfe-commits] r93873 - in /cfe/trunk: include/clang/Analysis/PathSensitive/CheckerVisitor.h lib/Analysis/GRExprEngine.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Tue Jan 19 01:25:54 PST 2010
Author: zhongxingxu
Date: Tue Jan 19 03:25:53 2010
New Revision: 93873
URL: http://llvm.org/viewvc/llvm-project?rev=93873&view=rev
Log:
Fix a serious bug: Tmp3 is the wrong destination set. We should create a new
intermediate destination set Tmp4.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.h
cfe/trunk/lib/Analysis/GRExprEngine.cpp
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.h?rev=93873&r1=93872&r2=93873&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/CheckerVisitor.h Tue Jan 19 03:25:53 2010
@@ -66,6 +66,11 @@
default:
assert(false && "Unsupport statement.");
return;
+ case Stmt::CompoundAssignOperatorClass:
+ static_cast<ImplClass*>(this)->PostVisitBinaryOperator(C,
+ static_cast<const BinaryOperator*>(S));
+ break;
+
#define POSTVISIT(NAME, FALLBACK) \
case Stmt::NAME ## Class:\
static_cast<ImplClass*>(this)->\
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=93873&r1=93872&r2=93873&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Tue Jan 19 03:25:53 2010
@@ -2952,13 +2952,13 @@
// Perform a load (the LHS). This performs the checks for
// null dereferences, and so on.
- ExplodedNodeSet Tmp3;
+ ExplodedNodeSet Tmp4;
SVal location = state->getSVal(LHS);
- EvalLoad(Tmp3, LHS, *I2, state, location);
+ EvalLoad(Tmp4, LHS, *I2, state, location);
- for (ExplodedNodeSet::iterator I3=Tmp3.begin(), E3=Tmp3.end(); I3!=E3;
- ++I3) {
- state = GetState(*I3);
+ for (ExplodedNodeSet::iterator I4=Tmp4.begin(), E4=Tmp4.end(); I4!=E4;
+ ++I4) {
+ state = GetState(*I4);
SVal V = state->getSVal(LHS);
// Get the computation type.
@@ -3008,7 +3008,7 @@
llvm::tie(state, LHSVal) = SVator.EvalCast(Result, state, LTy, CTy);
}
- EvalStore(Tmp3, B, LHS, *I3, state->BindExpr(B, Result),
+ EvalStore(Tmp3, B, LHS, *I4, state->BindExpr(B, Result),
location, LHSVal);
}
}
More information about the cfe-commits
mailing list