diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/parseTools.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 45046558..090d85ac 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -2038,12 +2038,19 @@ function processMathop(item) { } var bitsBefore = parseInt((item.params[0] ? item.params[0].type : item.type).substr(1)); // remove i to leave the number of bits left after this var bitsLeft = parseInt(((item.params[1] && item.params[1].ident) ? item.params[1].ident : item.type).substr(1)); // remove i to leave the number of bits left after this operation + var rawBits = getBits(item.type); + assert(rawBits <= 64); function integerizeBignum(value) { return makeInlineCalculation('VALUE-VALUE%1', value, 'tempBigIntI'); } - if ((type == 'i64' || paramTypes[0] == 'i64' || paramTypes[1] == 'i64' || idents[1] == '(i64)') && USE_TYPED_ARRAYS == 2) { + if ((type == 'i64' || paramTypes[0] == 'i64' || paramTypes[1] == 'i64' || idents[1] == '(i64)' || rawBits > 32) && USE_TYPED_ARRAYS == 2) { + // this code assumes i64 for the most part + if (ASSERTIONS && rawBits < 64) { + warnOnce('processMathop processing illegal non-i64 value: ' + [type, paramTypes, idents]) + } + var warnI64_1 = function() { warnOnce('Arithmetic on 64-bit integers in mode 1 is rounded and flaky, like mode 0!'); }; |