diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/library.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js index 957f69bd..9b63084f 100644 --- a/src/library.js +++ b/src/library.js @@ -7522,8 +7522,10 @@ LibraryManager.library = { l = (a + c)>>>0; h = (b + d)>>>0; overflow = ((h>>>0) < (b>>>0))|0; // Return whether addition overflowed even the high word. - h = (h + (((l>>>0) < (a>>>0))|0))>>>0; // Add carry from low word to high word on overflow. - overflow = overflow | (!h); // Check again for overflow. + if ((l>>>0) < (a>>>0)) { + h = (h + 1)>>>0; // Add carry from low word to high word on overflow. + overflow = overflow | (!h); // Check again for overflow. + } {{{ makeStructuralReturn(['l|0', 'h', 'overflow'], true) }}}; }, |