Skip to content
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

fix(boa): fixes panic on bigint size #1415

Merged
merged 3 commits into from Aug 21, 2021
Merged

Conversation

neeldug
Copy link
Contributor

@neeldug neeldug commented Jul 19, 2021

This Pull Request fixes/closes #1401.

It changes the following:

  • adds crude memory check on bigint bitsize
  • throws range error if exceeds 1B bits

@neeldug
Copy link
Contributor Author

neeldug commented Jul 19, 2021

@Razican @RageKnify wanted to get your thoughts since I wanted to do this approx memory check using Log2, but it's unimplemented on num-bigint, and the issue seems untouched, I'd give it a go but haven't got the time to create the docs/efficient implementation at the time.

- adds crude memory check on bigint bitsize
- throws range error if exceeds 1B bits

Closes boa-dev#1401
@neeldug
Copy link
Contributor Author

neeldug commented Jul 25, 2021

Weirdly enough this caused this to happen:

Test262 conformance changes:

Test result master count PR count difference
Total 78,897 78,897 0
Passed 28,323 28,322 -1
Ignored 15,614 15,614 0
Failed 34,960 34,961 +1
Panics 2 2 0
Conformance 35.90% 35.90% -0.00%
Broken tests:
test/built-ins/Map/prototype/set/append-new-values-normalizes-zero-key.js (previously Passed)

Copy link
Member

@RageKnify RageKnify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor suggestion for readability, but it might make it look weird. Not sure about the test, don't see how it can possibly be affected.

boa/src/bigint.rs Outdated Show resolved Hide resolved
@HalidOdat HalidOdat merged commit 7fc78f6 into boa-dev:master Aug 21, 2021
@neeldug neeldug deleted the fix-mem-panic branch August 21, 2021 19:54
@Razican Razican added this to the v0.13.0 milestone Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panicked at 'memory overflow'
4 participants