-
-
Notifications
You must be signed in to change notification settings - Fork 406
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] - Fix length/index in 32bit
architectures
#2196
Conversation
71a1603
to
09ee089
Compare
Test262 conformance changesVM implementation
|
Codecov Report
@@ Coverage Diff @@
## main #2196 +/- ##
==========================================
- Coverage 41.93% 41.92% -0.02%
==========================================
Files 231 231
Lines 21498 21499 +1
==========================================
- Hits 9015 9013 -2
- Misses 12483 12486 +3
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks!
bors r+ |
This PR fixes the length/index types from `usize` to `u64`, because in JavaScript the length can be from `0` to `2^53 - 1` it cannot be represented in a `usize`. On `64-bit` architectures this is fine because it is already a unsigned 64bit number and these changes essentially do nothing. But on 32bit architectures this was causing the length to be truncated giving an unexpected result. fixes/closes #2182 It changes the following: - Make length a `u64` to be able to represent all possible length values - Change `JsValue::to_length()` t return `u64` - Change `JsValue::to_index()` t return `u64`
Pull request successfully merged into main. Build succeeded: |
32bit
architectures32bit
architectures
This PR fixes the length/index types from
usize
tou64
, because in JavaScript the length can be from0
to2^53 - 1
it cannot be represented in ausize
. On64-bit
architectures this is fine because it is already a unsigned 64bit number and these changes essentially do nothing. But on 32bit architectures this was causing the length to be truncated giving an unexpected result.fixes/closes #2182
It changes the following:
u64
to be able to represent all possible length valuesJsValue::to_length()
t returnu64
JsValue::to_index()
t returnu64