We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d608cb5 commit 4e26d84Copy full SHA for 4e26d84
lib/SIL/Utils/MemoryLocations.cpp
@@ -396,10 +396,12 @@ bool MemoryLocations::analyzeAddrProjection(
396
if (isEmptyType(projection->getType(), projection->getFunction()))
397
return false;
398
399
- unsigned &subLocIdx = subLocationMap[std::make_pair(parentLocIdx, fieldNr)];
+ auto key = std::make_pair(parentLocIdx, fieldNr);
400
+ unsigned subLocIdx = subLocationMap[key];
401
if (subLocIdx == 0) {
402
subLocIdx = locations.size();
403
assert(subLocIdx > 0);
404
+ subLocationMap[key] = subLocIdx;
405
locations.push_back(Location(projection, subLocIdx, parentLocIdx));
406
407
Location &parentLoc = locations[parentLocIdx];
0 commit comments