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

[Merged by Bors] - Added a bit more integer operation consistency to ByteDataBlock creation #2272

Closed
wants to merge 1 commit into from

Conversation

Razican
Copy link
Member

@Razican Razican commented Sep 8, 2022

This Pull Request fixes a potential overflow when trying to convert a u64 into a usize and then trying to create a byte data block.

Related to this, we seem to be using a u64 and i64 as a general approach for an "integer", but ECMAScript doesn't have bounds for them, so they could be as big as infinite. Should we use u128 and i128 to have a bigger range?

This would add a performance penalty, though, and we don't have 128-bit platforms usually, so the benefit would probably be minimal, at least when trying to allocate.

@Razican Razican added the enhancement New feature or request label Sep 8, 2022
@Razican Razican added this to the v0.16.0 milestone Sep 8, 2022
@github-actions
Copy link

github-actions bot commented Sep 8, 2022

Test262 conformance changes

VM implementation

Test result main count PR count difference
Total 91,733 91,733 0
Passed 64,890 64,890 0
Ignored 16,580 16,580 0
Failed 10,263 10,263 0
Panics 0 0 0
Conformance 70.74% 70.74% 0.00%

@codecov
Copy link

codecov bot commented Sep 8, 2022

Codecov Report

Merging #2272 (1eafe4e) into main (b63d04c) will not change coverage.
The diff coverage is 50.00%.

@@           Coverage Diff           @@
##             main    #2272   +/-   ##
=======================================
  Coverage   41.33%   41.33%           
=======================================
  Files         234      234           
  Lines       22019    22019           
=======================================
  Hits         9101     9101           
  Misses      12918    12918           
Impacted Files Coverage Δ
boa_engine/src/builtins/array_buffer/mod.rs 9.62% <50.00%> (-0.15%) ⬇️
boa_engine/src/builtins/function/mod.rs 23.71% <0.00%> (+0.24%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@raskad raskad left a comment

Choose a reason for hiding this comment

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

Good change.

Regarding the interer sizes, I think we should open an issue for that and investigate what other engines do or if we can find any guidance in spec discussions.

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Looks good!

@jedel1043
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Sep 16, 2022
…ion (#2272)

This Pull Request fixes a potential overflow when trying to convert a `u64` into a `usize` and then trying to create a byte data block.

Related to this, we seem to be using a `u64` and `i64` as a general approach for an "integer", but ECMAScript doesn't have bounds for them, so they could be as big as infinite. Should we use `u128` and `i128` to have a bigger range?

This would add a performance penalty, though, and we don't have 128-bit platforms usually, so the benefit would probably be minimal, at least when trying to allocate.
@bors
Copy link

bors bot commented Sep 16, 2022

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Added a bit more integer operation consistency to ByteDataBlock creation [Merged by Bors] - Added a bit more integer operation consistency to ByteDataBlock creation Sep 16, 2022
@bors bors bot closed this Sep 16, 2022
@bors bors bot deleted the data_block_safety branch September 16, 2022 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants