diff options
Diffstat (limited to 'src/library.js')
-rw-r--r-- | src/library.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js index 2e0f3afb..f9864134 100644 --- a/src/library.js +++ b/src/library.js @@ -7482,9 +7482,10 @@ LibraryManager.library = { var l = 0, h = 0, overflow = 0; l = (a + c)>>>0; h = (b + d)>>>0; - if ((l>>>0) < (a>>>0)) { // iff we overflowed + if ((h>>>0) < (b>>>0)) overflow = 1; + if ((l>>>0) < (a>>>0)) { h = (h+1)>>>0; - overflow = 1; + if ((h>>>0) == 0) overflow = 1; // two possibilities to overflow here } {{{ makeStructuralReturn(['l|0', 'h', 'overflow'], true) }}}; }, |