Skip to content

Commit 0895ae1

Browse files
author
git apple-llvm automerger
committed
Merge commit '67a631b40673' from llvm.org/main into next
2 parents 4114291 + 67a631b commit 0895ae1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

llvm/lib/CodeGen/StackColoring.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,8 +1178,11 @@ void StackColoring::expungeSlotMap(DenseMap<int, int> &SlotRemap,
11781178
if (auto It = SlotRemap.find(i); It != SlotRemap.end()) {
11791179
int Target = It->second;
11801180
// As long as our target is mapped to something else, follow it.
1181-
while (SlotRemap.count(Target)) {
1182-
Target = SlotRemap[Target];
1181+
while (true) {
1182+
auto It = SlotRemap.find(Target);
1183+
if (It == SlotRemap.end())
1184+
break;
1185+
Target = It->second;
11831186
SlotRemap[i] = Target;
11841187
}
11851188
}

0 commit comments

Comments
 (0)