summaryrefslogtreecommitdiff
path: root/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2008-11-24 05:16:01 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2008-11-24 05:16:01 +0000
commit4b89e034a7778669c4f0888d66afef4cc03fb064 (patch)
treeb0483981a700104fb17a89e125a26ad60e0f4bdb /lib/Analysis/RegionStore.cpp
parentf2e8d98f7a8a6afdef0e9631af01c8e6c53cdf0d (diff)
downloadclang-4b89e034a7778669c4f0888d66afef4cc03fb064.tar.gz
clang-4b89e034a7778669c4f0888d66afef4cc03fb064.tar.bz2
clang-4b89e034a7778669c4f0888d66afef4cc03fb064.tar.xz
Strings are NULL terminated. So the region size should plus one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59943 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r--lib/Analysis/RegionStore.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index 73b25955c1..99c225f5e8 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -275,7 +275,7 @@ SVal RegionStoreManager::getSizeInElements(const GRState* St,
const StringLiteral* Str = SR->getStringLiteral();
// We intentionally made the size value signed because it participates in
// operations with signed indices.
- return NonLoc::MakeVal(getBasicVals(), Str->getByteLength(), false);
+ return NonLoc::MakeVal(getBasicVals(), Str->getByteLength() + 1, false);
}
if (const AnonTypedRegion* ATR = dyn_cast<AnonTypedRegion>(R)) {