Skip to content

Commit c730be1

Browse files
Try to restore earlier logic
1 parent b3570ab commit c730be1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ir/effects.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,11 @@ class EffectAnalyzer {
417417
assert(!((trap && other.throws()) || (throws() && other.trap)));
418418
// We can't reorder an implicit trap in a way that could alter what global
419419
// state is modified.
420-
if ((trap && other.writesGlobalState()) ||
421-
(other.trap && writesGlobalState())) {
422-
return true;
420+
if (transfersControlFlow() || other.transfersControlFlow()) {
421+
if ((trap && other.writesGlobalState()) ||
422+
(other.trap && writesGlobalState())) {
423+
return true;
424+
}
423425
}
424426
return false;
425427
}

0 commit comments

Comments
 (0)