aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-11-26 18:49:16 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-11-26 18:49:16 -0800
commitd9af31471571b868b7a7da57e7d9f14d2f52bd5a (patch)
treeb5bc58ae79b06bcc7fb939a27f4101333a3b0a43
parent11552c29713ee2a04470accd652d1f842060a33f (diff)
optimize overflow correction for 32 bits
-rw-r--r--src/parseTools.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index aa1c37b1..7060dc3e 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1414,7 +1414,9 @@ function handleOverflow(text, bits) {
PGO ? ', "' + Debugging.getIdentifier() + '"' : ''
) + ')';
if (!correct) return text;
- if (bits <= 32) {
+ if (bits == 32) {
+ return '((' + text + ')|0)';
+ } else if (bits < 32) {
return '((' + text + ')&' + (Math.pow(2, bits) - 1) + ')';
} else {
return text; // We warned about this earlier