From f556cd6cb9f6a34e1b1679aadd7b07fd725f10c5 Mon Sep 17 00:00:00 2001 From: Zhongxing Xu Date: Mon, 24 Nov 2008 05:16:01 +0000 Subject: Strings are NULL terminated. So the region size should plus one. llvm-svn: 59943 --- clang/lib/Analysis/RegionStore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Analysis/RegionStore.cpp') diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp index 73b25955c14..99c225f5e83 100644 --- a/clang/lib/Analysis/RegionStore.cpp +++ b/clang/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(R)) { -- cgit v1.2.3