Skip to content

Commit 3746c35

Browse files
authored
Merge pull request swiftlang#36443 from eeckstein/main
2 parents 934ec4d + 4e26d84 commit 3746c35

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/SIL/Utils/MemoryLocations.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,12 @@ bool MemoryLocations::analyzeAddrProjection(
396396
if (isEmptyType(projection->getType(), projection->getFunction()))
397397
return false;
398398

399-
unsigned &subLocIdx = subLocationMap[std::make_pair(parentLocIdx, fieldNr)];
399+
auto key = std::make_pair(parentLocIdx, fieldNr);
400+
unsigned subLocIdx = subLocationMap[key];
400401
if (subLocIdx == 0) {
401402
subLocIdx = locations.size();
402403
assert(subLocIdx > 0);
404+
subLocationMap[key] = subLocIdx;
403405
locations.push_back(Location(projection, subLocIdx, parentLocIdx));
404406

405407
Location &parentLoc = locations[parentLocIdx];

0 commit comments

Comments
 (0)