diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-12-25 14:13:17 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-12-25 14:13:17 -0800 |
commit | aab26adc6a63c770dae29d1cc5d8c0e29e02871a (patch) | |
tree | ee9d4c5c4764b2fe0757128e6a9714917da44265 /tools/js-optimizer.js | |
parent | 7869ed3239dcd6ccef1fab2db9e6a3be582ff33e (diff) |
invalidate calls in if bodies in eliminator
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r-- | tools/js-optimizer.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index 62161738..dbef9c0c 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -1715,6 +1715,10 @@ function eliminate(ast, memSafe) { } 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]); |