forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix exponent overflow in BigInt exponentiation
Summary: The BigInt exponentiation code currently truncates the first digit of a BigInt from 64 to 32 bits. This means that for a single digit BigInt exponent that has a value larger than `UINT32_MAX`, we end up truncating the exponent and producing an incorrect value. To fix this, do not truncate the exponent until after we have guaranteed that it will fit in 32 bits. Reviewed By: fbmal7 Differential Revision: D47275000 fbshipit-source-id: 881b7653d0394b88aad9db11fb6f99e675a7e38f
- Loading branch information
1 parent
1c18a40
commit 132de30
Showing
2 changed files
with
31 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters