We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
Compile boa_engine to wasm32, panic when create empty array.
file: boa_engine/src/buildins/array/mod.rs
boa_engine/src/buildins/array/mod.rs
pub(crate) fn array_create( length: usize, prototype: Option<JsObject>, context: &mut Context, ) -> JsResult<JsObject> { // 1. If length > 2^32 - 1, throw a RangeError exception. if length > 2usize.pow(32) - 1 { return context.throw_range_error("array exceeded max size"); }
Change this line if length > to:
if length >
if length > u32::MAX as usize {
To Reproduce Compile boa to was32 or other 32bit targets.
Create a empty array cause panic, like:
let a = [];
Expected behavior
2 ^ 32 panic under 32bit arch
2 ^ 32
Build environment (please complete the following information):
Additional context n/a
The text was updated successfully, but these errors were encountered:
32bit
efff9d6
HalidOdat
Successfully merging a pull request may close this issue.
Describe the bug
Compile boa_engine to wasm32, panic when create empty array.
file:
boa_engine/src/buildins/array/mod.rs
Change this line
if length >
to:To Reproduce
Compile boa to was32 or other 32bit targets.
Create a empty array cause panic, like:
Expected behavior
2 ^ 32
panic under 32bit archBuild environment (please complete the following information):
Additional context
n/a
The text was updated successfully, but these errors were encountered: