Skip to content

Commit ea4d9e4

Browse files
authored
Effects: Add missing combining logic for MayNotReturn (#6635)
Without that logic we could end up dropping that particular effect. This actually made a test pass when it should not: the modified test here has a function with effects that are ok to remove, but it had a loop which adds MayNotReturn which we should actually not remove, so it was removed erroneously. To fix the test, add other effects there (local ones) that we can see are removable. Also add a function with a loop to test that we do not remove an infinite loop, which adds coverage for the fix here.
1 parent 9347a22 commit ea4d9e4

File tree

2 files changed

+296
-81
lines changed

2 files changed

+296
-81
lines changed

src/ir/effects.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ class EffectAnalyzer {
364364
isAtomic = isAtomic || other.isAtomic;
365365
throws_ = throws_ || other.throws_;
366366
danglingPop = danglingPop || other.danglingPop;
367+
mayNotReturn = mayNotReturn || other.mayNotReturn;
367368
for (auto i : other.localsRead) {
368369
localsRead.insert(i);
369370
}

0 commit comments

Comments
 (0)