diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-11-08 14:54:18 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-11-08 14:54:18 -0800 |
commit | c715cec68f4c965ca443669fcf48eecfa70b52d8 (patch) | |
tree | 61203a49205021e1525655deb9a32074d00fa0bc /tools/js-optimizer.js | |
parent | 7f870cf9c357f6a1138ba612ace7d7249f85e250 (diff) |
invalidate calls on conditionals in js optimizer, to avoid eliminating into a non-executing code path
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 022bdf47..36244298 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -2485,6 +2485,10 @@ function eliminate(ast, memSafe) { } else if (type === 'return') { if (node[1]) traverseInOrder(node[1]); } else if (type === 'conditional') { + if (!callsInvalidated) { // invalidate calls, since we cannot eliminate them into a branch of an LLVM select/JS conditional that does not execute + invalidateCalls(); + callsInvalidated = true; + } traverseInOrder(node[1]); traverseInOrder(node[2]); traverseInOrder(node[3]); |