diff options
-rw-r--r-- | src/ir/effects.h | 2 | ||||
-rw-r--r-- | test/binaryen.js/sideffects.js | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/ir/effects.h b/src/ir/effects.h index ff641e4d9..d2afc8133 100644 --- a/src/ir/effects.h +++ b/src/ir/effects.h @@ -504,7 +504,7 @@ struct EffectAnalyzer }; uint32_t getSideEffects() const { uint32_t effects = 0; - if (transfersControlFlow()) { + if (branchesOut || hasExternalBreakTargets()) { effects |= SideEffects::Branches; } if (calls) { diff --git a/test/binaryen.js/sideffects.js b/test/binaryen.js/sideffects.js index 7db9ab329..76bc1db68 100644 --- a/test/binaryen.js/sideffects.js +++ b/test/binaryen.js/sideffects.js @@ -95,11 +95,11 @@ assert( ); // If exception handling feature is enabled, calls can throw -var module_all_features = new binaryen.Module(); -module_all_features.setFeatures(binaryen.Features.All); +module.setFeatures(binaryen.Features.All); assert( binaryen.getSideEffects( - module.call("test", [], binaryen.i32) + module.call("test", [], binaryen.i32), + module.getFeatures() ) == binaryen.SideEffects.Calls | binaryen.SideEffects.Throws |