From 8215a28597a464489d4678aa57cdccef80f427df Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 19 Jun 2013 16:42:35 -0700 Subject: [PATCH] fix bug with reducing f()|0|const --- tools/js-optimizer.js | 2 +- tools/test-js-optimizer-asm-pre-output.js | 1 + tools/test-js-optimizer-asm-pre.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index 862b39ebf..b02ae3cca 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -459,7 +459,7 @@ function simplifyExpressionsPre(ast) { go = true; } if (!go) { - stack.push(2); + stack.push(1); return; } // We might be able to remove this correction diff --git a/tools/test-js-optimizer-asm-pre-output.js b/tools/test-js-optimizer-asm-pre-output.js index 1716059f3..0e95580fc 100644 --- a/tools/test-js-optimizer-asm-pre-output.js +++ b/tools/test-js-optimizer-asm-pre-output.js @@ -18,6 +18,7 @@ function a() { f(g() | 0); f(g() | 0 & -1); f((g() | 0) >> 2); + $56 = _fcntl() | 0 | 1; } function b($this, $__n) { $this = $this | 0; diff --git a/tools/test-js-optimizer-asm-pre.js b/tools/test-js-optimizer-asm-pre.js index 14531c231..4f3ba7804 100644 --- a/tools/test-js-optimizer-asm-pre.js +++ b/tools/test-js-optimizer-asm-pre.js @@ -19,6 +19,7 @@ function a() { f(g() | 0 | 0); f(g() | 0 & -1); f((g() | 0) >> 2); + $56 = (_fcntl() | 0) | 1; } function b($this, $__n) { $this = $this | 0;