diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-08-03 06:34:25 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-08-03 06:34:25 +0000 |
commit | e3273e78da4716f9c999ae207f6898f376a6e1a4 (patch) | |
tree | 4a58854175e9a4f13f72ed567caa96ce3f8f0fa5 /lib/Checker/MemRegion.cpp | |
parent | e888233f6b115d3b0dd73bcb5f35e93794408542 (diff) |
Allow offsets to be negative. Out-of-bound cases are checked elsewhere. We
shouldn't put restrictions in store manager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110106 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/MemRegion.cpp')
-rw-r--r-- | lib/Checker/MemRegion.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Checker/MemRegion.cpp b/lib/Checker/MemRegion.cpp index 87eed2a287..58006708fa 100644 --- a/lib/Checker/MemRegion.cpp +++ b/lib/Checker/MemRegion.cpp @@ -830,7 +830,7 @@ RegionRawOffset ElementRegion::getAsArrayOffset() const { RegionOffset MemRegion::getAsOffset() const { const MemRegion *R = this; - uint64_t Offset = 0; + int64_t Offset = 0; while (1) { switch (R->getKind()) { @@ -854,7 +854,6 @@ RegionOffset MemRegion::getAsOffset() const { SVal Index = ER->getIndex(); if (const nonloc::ConcreteInt *CI=dyn_cast<nonloc::ConcreteInt>(&Index)) { int64_t i = CI->getValue().getSExtValue(); - assert(i >= 0); CharUnits Size = getContext().getTypeSizeInChars(EleTy); Offset += i * Size.getQuantity() * 8; } else { |