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
diff --git a/lib/Checker/MemRegion.cpp b/lib/Checker/MemRegion.cpp
index 87eed2a..5800670 100644
--- a/lib/Checker/MemRegion.cpp
+++ b/lib/Checker/MemRegion.cpp
@@ -830,7 +830,7 @@
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 @@
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 {