aboutsummaryrefslogtreecommitdiff
path: root/src/preamble.js
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2011-02-13 21:01:26 -0800
committerAlon Zakai <azakai@mozilla.com>2011-02-13 21:01:26 -0800
commita24e070ab3d7497d52d0808159accbb9f6461020 (patch)
treecedbfc4f41d01c4cbf89b31e53fae67c1131a35d /src/preamble.js
parent4c884d8526826ee15ba4475b7bc0c9acb4c609bb (diff)
tweak sign and overflow checks
Diffstat (limited to 'src/preamble.js')
-rw-r--r--src/preamble.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/preamble.js b/src/preamble.js
index c2941902..b471da92 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -373,7 +373,7 @@ function intArrayToString(array) {
function unSign(value, bits) {
if (value >= 0) return value;
#if CHECK_SIGNS
- print('WARNING: unSign needed, ' + [value, bits] + ' at ' + new Error().stack);
+ abort('unSign needed, data: ' + [value, bits]);
#endif
return bits <= 32 ? 2*Math.abs(1 << (bits-1)) + value // Need some trickery, since if bits == 32, we are right at the limit of the bits JS uses in bitshifts
: Math.pow(2, bits) + value;
@@ -388,7 +388,7 @@ function reSign(value, bits) {
: Math.pow(2, bits-1);
if (value >= half) {
#if CHECK_SIGNS
- print('WARNING: reSign needed, ' + [value, bits] + ' at ' + new Error().stack);
+ abort('reSign needed, data: ' + [value, bits]);
#endif
value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts
}