aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-31 12:23:09 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-31 12:23:09 -0800
commit5edd66f9c9d489c7e78dc6c60751a29848219e08 (patch)
tree9e70a083f1aece7cab38f28744a04a6ccee763b4 /src/library.js
parentac9746686208c6d1a00c90830a93cc5a620bc11e (diff)
fix parseInt64
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/library.js b/src/library.js
index 7438b0ad..61665920 100644
--- a/src/library.js
+++ b/src/library.js
@@ -3885,13 +3885,7 @@ LibraryManager.library = {
}
if (!ok) {
___setErrNo(ERRNO_CODES.EINVAL);
- return [0, 0];
- }
-
- try {
- i64Math.fromString(Pointer_stringify(start, str - start), finalBase, min, max, unsign);
- } catch(e) {
- ___setErrNo(ERRNO_CODES.ERANGE); // not quite correct
+ {{{ makeStructuralReturn(['0', '0']) }}};
}
// Set end pointer.
@@ -3899,9 +3893,13 @@ LibraryManager.library = {
{{{ makeSetValue('endptr', 0, 'str', '*') }}}
}
- var ret = i64Math.result.slice(0);
+ try {
+ i64Math.fromString(Pointer_stringify(start, str - start), finalBase, min, max, unsign);
+ } catch(e) {
+ ___setErrNo(ERRNO_CODES.ERANGE); // not quite correct
+ }
- return ret;
+ {{{ makeStructuralReturn([makeGetTempDouble(0), makeGetTempDouble(1)]) }}};
},
#endif
strtoll__deps: ['_parseInt64'],