diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-03-21 19:50:03 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-03-21 19:50:03 -0700 |
commit | b956a15fb40aa661c7feb0f8b078f1bb0ea1d622 (patch) | |
tree | 6b8a457060fd2765232d0d3705fde59f674383cc /src/library.js | |
parent | 24856d20699818b35f01963e4144c87d1a5c56ff (diff) |
poppler-related tweaks
Diffstat (limited to 'src/library.js')
-rw-r--r-- | src/library.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js index 08daceb1..54834d17 100644 --- a/src/library.js +++ b/src/library.js @@ -1253,10 +1253,18 @@ function reSign(value, bits, ignore) { : Math.pow(2, bits-1); if (value >= half) { #if CHECK_SIGNS - if (!ignore) CorrectionsMonitor.note('ReSign'); + if (!ignore) CorrectionsMonitor.note('ReSign'); #endif value = -2*half + value; // Cannot bitshift half, as it may be at the limit of the bits JS uses in bitshifts } +#if CHECK_SIGNS + // If this is a 32-bit value, then it should be corrected at this point. And, + // without CHECK_SIGNS, we would just do the |0 shortcut, so check that that + // would indeed give the exact same result. + if (bits === 32 && (value|0) !== value && typeof value !== 'boolean') { + CorrectionsMonitor.note('ReSign'); + } +#endif return value; } |