Strings are NULL terminated. So the region size should plus one.
llvm-svn: 59943
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user