diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-02-17 15:56:23 +0100 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-02-17 15:56:23 +0100 |
commit | d9d2876b0b7370ff99c37483a5f6e97515499e81 (patch) | |
tree | 15b4258537414245d968370056bf3272e5942320 /src/preamble.js | |
parent | 49b2b5541557f60ac263e070850ee52bb91898fa (diff) |
fix CHECK_OVERFLOW
Diffstat (limited to 'src/preamble.js')
-rw-r--r-- | src/preamble.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/preamble.js b/src/preamble.js index a5342f89..503b09f1 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -163,15 +163,17 @@ function CHECK_OVERFLOW(value, bits, ignore, sig) { if (value === Infinity || value === -Infinity || value >= twopbits1 || value < -twopbits1) { throw 'SignedOverflow'; if (value === Infinity || value === -Infinity || Math.abs(value) >= twopbits) throw 'Overflow'; + } #else if (value === Infinity || value === -Infinity || Math.abs(value) >= twopbits) { throw 'Overflow'; + } #endif #if CORRECT_OVERFLOWS - // Fail on >32 bits - we warned at compile time - if (bits <= 32) { - value = value & (twopbits - 1); - } + // Fail on >32 bits - we warned at compile time + if (bits <= 32) { + value = value & (twopbits - 1); + } #endif return value; } |