aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-06-26 11:08:13 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-06-26 11:08:13 -0700
commitb54c74693af827f27dc490d8b1e7f46f82ac1167 (patch)
treebb9c30a11f2ed109d2f578dcbaf05a3528f18147 /tools
parent501022cbaa9e63cab9cc218ee0239256945a3061 (diff)
fix crash in asmLoopOptimizer
Diffstat (limited to 'tools')
-rw-r--r--tools/js-optimizer.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index c772f667..151e573a 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -2806,7 +2806,7 @@ function asmLoopOptimizer(ast) {
// while (1) { .. if (..) { break } } ==> do { .. } while(..)
var stats = node[2][1];
var last = stats[stats.length-1];
- if (last && last[0] === 'if' && !last[3] && last[2][0] === 'block' && last[2][1][0][0] === 'break' && !last[2][1][0][1]) {
+ if (last && last[0] === 'if' && !last[3] && last[2][0] === 'block' && last[2][1][0] && last[2][1][0][0] === 'break' && !last[2][1][0][1]) {
var conditionToBreak = last[1];
stats.pop();
node[0] = 'do';