From aab26adc6a63c770dae29d1cc5d8c0e29e02871a Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 25 Dec 2012 14:13:17 -0800 Subject: invalidate calls in if bodies in eliminator --- tools/js-optimizer.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tools/js-optimizer.js') 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]); -- cgit v1.2.3-70-g09d2