Skip to content

Commit 366c2bf

Browse files
committed
[TSAR, Memory, ArrayAccess] Fix, update end of array list only if necessary.
1 parent c6a36e9 commit 366c2bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Analysis/Memory/DIArrayAccess.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ void DIArrayAccessInfo::erase(const Array &V) {
226226
--PrevItr;
227227
auto PrevArrayItr =
228228
Info.get<ArrayToAccessMap>().find(PrevItr->getArray());
229-
if (PrevArrayItr != Info.get<ArrayToAccessMap>().end())
229+
if (PrevArrayItr != Info.get<ArrayToAccessMap>().end() &&
230+
PrevArrayItr->get<End>()->getArray() == V)
230231
PrevArrayItr->get<End>() = I->get<End>();
231232
}
232233
Info.get<ArrayToAccessMap>().erase(V);

0 commit comments

Comments
 (0)