aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library.js2
-rw-r--r--src/runtime.js4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/library.js b/src/library.js
index 0e7b8b54..ad1ff696 100644
--- a/src/library.js
+++ b/src/library.js
@@ -3449,7 +3449,7 @@ LibraryManager.library = {
},
strtoll__deps: ['_parseInt'],
strtoll: function(str, endptr, base) {
- return __parseInt(str, endptr, base, -9223372036854775808, 9223372036854775807, 64); // LLONG_MIN, LLONG_MAX; imprecise.
+ return __parseInt(str, endptr, base, -9223372036854775200, 9223372036854775200, 64); // LLONG_MIN, LLONG_MAX; imprecise.
},
strtol__deps: ['_parseInt'],
strtol: function(str, endptr, base) {
diff --git a/src/runtime.js b/src/runtime.js
index 495e72dd..6f17028a 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -79,9 +79,9 @@ var RuntimeGenerator = {
// Rounding is inevitable if the number is large. This is a particular problem for small negative numbers
// (-1 will be rounded!), so handle negatives separately and carefully
makeBigInt: function(low, high, unsigned) {
- return '((' + unsigned + ' || (' + makeSignOp(high, 'i32', 're', 1, 1) + ' >= 0))' +
+ return '(' + unsigned +
' ? (' + makeSignOp(low, 'i32', 'un', 1, 1) + '+(' + makeSignOp(high, 'i32', 'un', 1, 1) + '*4294967296))' +
- ' : (' + makeSignOp(low, 'i32', 're', 1, 1) + '+(1+' + makeSignOp(high, 'i32', 're', 1, 1) + ')*4294967296))';
+ ' : (' + makeSignOp(low, 'i32', 'un', 1, 1) + '+(' + makeSignOp(high, 'i32', 're', 1, 1) + '*4294967296)))';
}
};