diff options
author | Dan Gohman <sunfish@google.com> | 2014-02-10 16:38:43 -0800 |
---|---|---|
committer | Dan Gohman <sunfish@google.com> | 2014-02-10 16:40:31 -0800 |
commit | bf2ff7290aa65659e9e3ec7fd48e818f98b82832 (patch) | |
tree | 118f7c8652113c5dd30684ad691ae388576cd832 | |
parent | 5afcd4860e7cc14596536874e13de71c4b7326af (diff) |
Handle while statements with empty bodies.
When a while statement body is empty, it contains an empty block with no
statement list.
-rw-r--r-- | tools/js-optimizer.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index fc8b0561..f9be66df 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -5127,7 +5127,7 @@ function fixDotZero(js) { function asmLastOpts(ast) { traverseGeneratedFunctions(ast, function(fun) { traverse(fun, function(node, type) { - if (type === 'while' && node[1][0] === 'num' && node[1][1] === 1 && node[2][0] === 'block') { + if (type === 'while' && node[1][0] === 'num' && node[1][1] === 1 && node[2][0] === 'block' && node[2].length == 2) { // This is at the end of the pipeline, we can assume all other optimizations are done, and we modify loops // into shapes that might confuse other passes |