summaryrefslogtreecommitdiff
path: root/src/ast_utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ast_utils.h')
-rw-r--r--src/ast_utils.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ast_utils.h b/src/ast_utils.h
index 598081342..190b2876e 100644
--- a/src/ast_utils.h
+++ b/src/ast_utils.h
@@ -56,7 +56,9 @@ struct EffectAnalyzer : public WasmWalker<EffectAnalyzer> {
// checks if these effects would invalidate another set (e.g., if we write, we invalidate someone that reads, they can't be moved past us)
bool invalidates(EffectAnalyzer& other) {
- return branches || ((writesMemory || calls) && other.accessesMemory()) || (writesLocal && other.accessesLocal());
+ return branches || other.branches
+ || ((writesMemory || calls) && other.accessesMemory()) || (writesLocal && other.accessesLocal())
+ || (accessesMemory() && (other.writesMemory || other.calls)) || (accessesLocal() && other.writesLocal);
}
void visitIf(If *curr) { branches = true; }