Skip to content

Commit 8bcb8c6

Browse files
committed
Fix PrunedLiveness.empty() to consider the users.
1 parent bffe0e7 commit 8bcb8c6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/swift/SIL/PrunedLiveness.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,9 @@ class PrunedLiveness {
484484

485485
bool empty() const {
486486
assert(!liveBlocks.empty() || users.empty());
487-
return liveBlocks.empty();
487+
// There may be a liveBlock created by initializeDefBlock with no users. The
488+
// true test of emptiness is whether there are any users.
489+
return users.empty();
488490
}
489491

490492
void clear() {

0 commit comments

Comments
 (0)