aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-02-23 10:51:41 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-02-23 10:51:41 -0800
commit644a969e1cf82bec7d0a8f003986c6d4aab84bdd (patch)
tree0eaa0ac7bc22b30fca94d10d712282d12ff97294
parent58cad1436d5d03d71fe554081e590a9202911cb2 (diff)
fix default bits for integer multiply
-rw-r--r--src/parseTools.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index f19eb9d5..7d1a7cd9 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1392,7 +1392,7 @@ function getFastValue(a, op, b, type) {
}
if (!(type in Runtime.FLOAT_TYPES)) {
// if guaranteed small enough to not overflow into a double, do a normal multiply
- var bits = getBits(type);
+ var bits = getBits(type) || 32; // default is 32-bit multiply for things like getelementptr indexes
if ((isNumber(a) && Math.abs(a) < TWO_TWENTY) || (isNumber(b) && Math.abs(b) < TWO_TWENTY) || bits < 32) {
return '(((' + a + ')*(' + b + '))&' + ((Math.pow(2, bits)-1)|0) + ')'; // keep a non-eliminatable coercion directly on this
}