New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hermes should throw an exception when BigInts use unsigned shift #1212
Labels
bug
Something isn't working
Comments
This problem may also exists when BigInt mod zero. |
Wow, these never end, do they? :-) Thanks for reporting this, we will fix it. |
tmikov
added a commit
to tmikov/hermes
that referenced
this issue
Dec 10, 2023
Summary: BigInt differs from numbers - several bigint operations can throw an exception, specifically: - >>> is not allowed at all and throws - / and % can result in division by zero Improve the side effect model and add a test. This diff was ported from SH. Closes facebook#1212 Differential Revision: D52013223
tmikov
pushed a commit
to tmikov/hermes
that referenced
this issue
Dec 15, 2023
Summary: BigInt differs from numbers - several bigint operations can throw an exception, specifically: - >>> is not allowed at all and throws - / and % can result in division by zero Improve the side effect model and add a test. This diff was ported from SH. Closes facebook#1212 Differential Revision: D52013223
facebook-github-bot
pushed a commit
that referenced
this issue
Dec 15, 2023
Summary: BigInt differs from numbers - several bigint operations can throw an exception, specifically: - >>> is not allowed at all and throws - / and % can result in division by zero Improve the side effect model and add a test. Reported in #1212 Reviewed By: avp Differential Revision: D52013220 fbshipit-source-id: 34606cb7d53a3db3ea49dd026661b7fd340583e5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
Hermes should throw an exception when BigInts use unsigned shift, but it did not because of Dead Code Elimination.
BinaryOperatorInst is Eliminated by DCE and does not throw an exception. This optimization changes the semantics of JavaSript program.
The problem may be related to the side effect of BigInt for UnsignedRightShiftKind.
Hermes version: ebf7889 (latest version)
OS version (if any): Linux, MacOS
Steps To Reproduce
code example:
test.js
The Expected Behavior
The result of step 2 and step 3 is different. In full optimization level, Hermes shoud throw an exception "TypeError: BigInts have no unsigned shift".
The text was updated successfully, but these errors were encountered: