Skip to content

Commit b129553

Browse files
committed
[TSAR, Memory] Fix expand function for MemoryLocationRange.
1 parent 9c08b91 commit b129553

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/tsar/Analysis/Memory/MemoryLocationRange.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,10 @@ struct MemoryLocationRange {
224224
return *this;
225225
assert(UpperBound.hasValue() && "UpperBound must have a value!");
226226
auto FullSize = UpperBound.getValue();;
227-
for (std::size_t I = 1; I < DimList.size(); ++I)
227+
for (std::size_t I = 0; I < DimList.size(); ++I)
228228
FullSize *= DimList[I].DimSize;
229+
if (FullSize == 0)
230+
return MemoryLocationRange(Ptr, 0, UnknownSize, AATags);
229231
return MemoryLocationRange(Ptr, 0, LocationSize(FullSize), AATags);
230232
}
231233
};

0 commit comments

Comments
 (0)