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

panic: Checked above the range of nextcp #2657

Closed
langston-barrett opened this issue Mar 13, 2023 · 0 comments
Closed

panic: Checked above the range of nextcp #2657

langston-barrett opened this issue Mar 13, 2023 · 0 comments
Labels
bug Something isn't working Internal Category for changelog
Milestone

Comments

@langston-barrett
Copy link

langston-barrett commented Mar 13, 2023

Minimized from a ChakraCore test case with treereduce

To Reproduce

function f() {
     var_0 =  Array();
    for ( var_1 = 0; ; var_1 += 1024) {
        var_0[var_1] = String.fromCodePoint(var_1);
    }
}
try {
    f();
}
catch(e) {
}
thread 'main' panicked at 'Checked above the range of `nextcp`', boa_engine/src/builtins/string/mod.rs:270:47
stack backtrace:
   0: rust_begin_unwind
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:64:14
   2: core::panicking::panic_display
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:147:5
   3: core::panicking::panic_str
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:131:5
   4: core::option::expect_failed
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/option.rs:1924:5
   5: boa_engine::builtins::string::String::from_code_point
   6: boa_engine::vm::code_block::<impl boa_engine::object::jsobject::JsObject>::call_internal
   7: boa_engine::object::internal_methods::function::function_call{{reify.shim}}
   8: <boa_engine::vm::opcode::call::Call as boa_engine::vm::opcode::Operation>::execute
   9: boa_engine::vm::<impl boa_engine::context::Context>::execute_instruction
  10: boa_engine::vm::<impl boa_engine::context::Context>::run
  11: boa_engine::vm::code_block::<impl boa_engine::object::jsobject::JsObject>::call_internal
  12: boa_engine::object::internal_methods::function::function_call{{reify.shim}}
  13: <boa_engine::vm::opcode::call::Call as boa_engine::vm::opcode::Operation>::execute
  14: boa_engine::vm::<impl boa_engine::context::Context>::execute_instruction
  15: boa_engine::vm::<impl boa_engine::context::Context>::run
  16: boa_engine::context::Context::execute
  17: boa_engine::context::Context::eval_script
  18: boa::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

I did search the issue tracker this time, like so 😄

@langston-barrett langston-barrett added the bug Something isn't working label Mar 13, 2023
@jedel1043 jedel1043 added the Internal Category for changelog label Mar 14, 2023
@jedel1043 jedel1043 modified the milestone: v0.17.0 Mar 14, 2023
bors bot pushed a commit that referenced this issue Mar 14, 2023
This Pull Request fixes #2657.

It changes the following:

- Handles surrogates when trying to convert f64 codepoints to u16.
- Replaces `abs().floor()` with `truncate` on `is_float_integer`.
@bors bors bot closed this as completed in 5a3186d Mar 14, 2023
@jedel1043 jedel1043 added this to the v0.17.0 milestone May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Internal Category for changelog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants