aboutsummaryrefslogtreecommitdiff
path: root/tools/js-optimizer.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r--tools/js-optimizer.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 85a7b214..77c48a23 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -1937,6 +1937,10 @@ function eliminate(ast, memSafe, asm) {
} else if (type == 'if') {
if (allowTracking) {
traverseInOrder(node[1]); // can eliminate into condition, but nowhere else
+ if (!callsInvalidated) { // invalidate calls, since we cannot eliminate them into an if that may not execute!
+ invalidateCalls();
+ callsInvalidated = true;
+ }
allowTracking = false;
traverseInOrder(node[2]); // 2 and 3 could be 'parallel', really..
if (node[3]) traverseInOrder(node[3]);