diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-06-10 17:58:21 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-06-10 17:58:21 -0700 |
commit | 886e3158cf5d95a2c2721e5eb9a1c3ac4461f805 (patch) | |
tree | db19d53d4548391d316fec33954ed7d5d3cfb68b | |
parent | e60c9c89b2100951666abc0ed2560a7ceb0ee3d8 (diff) |
coerce output of integer modulus, since x%0 is NaN, which is not an integer
-rw-r--r-- | src/parseTools.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/parseTools.js b/src/parseTools.js index 3949491e..687faaa8 100644 --- a/src/parseTools.js +++ b/src/parseTools.js @@ -2204,7 +2204,7 @@ function processMathop(item) { case 'sub': return handleOverflow(getFastValue(idents[0], '-', idents[1], item.type), bits); case 'sdiv': case 'udiv': return makeRounding(getFastValue(idents[0], '/', idents[1], item.type), bits, op[0] === 's'); case 'mul': return getFastValue(idents[0], '*', idents[1], item.type); // overflow handling is already done in getFastValue for '*' - case 'urem': case 'srem': return getFastValue(idents[0], '%', idents[1], item.type); + case 'urem': case 'srem': return makeRounding(getFastValue(idents[0], '%', idents[1], item.type), bits, op[0] === 's'); case 'or': { if (bits > 32) { assert(bits === 64, 'Too many bits for or: ' + bits); |