[cfe-commits] r60248 - in /cfe/trunk: include/clang/Analysis/PathSensitive/MemRegion.h lib/Analysis/RegionStore.cpp
Zhongxing Xu
xuzhongxing at gmail.com
Sat Nov 29 04:05:05 PST 2008
Author: zhongxingxu
Date: Sat Nov 29 06:05:04 2008
New Revision: 60248
URL: http://llvm.org/viewvc/llvm-project?rev=60248&view=rev
Log:
To be consistent, make the index of the ElementRegion always signed.
Modified:
cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h
cfe/trunk/lib/Analysis/RegionStore.cpp
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h?rev=60248&r1=60247&r2=60248&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/MemRegion.h Sat Nov 29 06:05:04 2008
@@ -415,7 +415,11 @@
SVal Index;
ElementRegion(SVal Idx, const MemRegion* sReg)
- : TypedRegion(sReg, ElementRegionKind), Index(Idx) {}
+ : TypedRegion(sReg, ElementRegionKind), Index(Idx) {
+ // The index must be signed.
+ if (nonloc::ConcreteInt* CI = dyn_cast<nonloc::ConcreteInt>(&Idx))
+ assert(CI->getValue().isSigned());
+ }
static void ProfileRegion(llvm::FoldingSetNodeID& ID, SVal Idx,
const MemRegion* superRegion);
Modified: cfe/trunk/lib/Analysis/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/RegionStore.cpp?rev=60248&r1=60247&r2=60248&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/RegionStore.cpp (original)
+++ cfe/trunk/lib/Analysis/RegionStore.cpp Sat Nov 29 06:05:04 2008
@@ -646,7 +646,7 @@
nonloc::CompoundVal::iterator VI = CV.begin(), VE = CV.end();
for (; i != Size; ++i) {
- nonloc::ConcreteInt Idx(getBasicVals().getValue(llvm::APSInt(i)));
+ nonloc::ConcreteInt Idx(getBasicVals().getValue(llvm::APSInt(i, false)));
ElementRegion* ER = MRMgr.getElementRegion(Idx, R);
More information about the cfe-commits
mailing list