mirror of
https://github.com/denoland/rusty_v8.git
synced 2024-11-21 20:28:58 +00:00
7b6451aed4
A subtle unsoundness / undefined behaviour made its way into the fairly recently added ExternalOneByteStringResource object: The as_str API is not sound as the data inside may be be Latin-1, not ASCII. As the API was not used anywhere in deno or deno_core, I opted to simply remove it and replace it with an as_bytes API. I also modified the test to showcase the Latin-1 string case and added copious notes and explanations around the code to make sure this doesn't accidentally happen again. The likely reason why the API originally slipped in is because the OneByteConst has this API where it is safe because the OneByteConst creation checks the data for ASCII-ness. I also tried to add an API to extract an Option<&'static OneByteConst> from an &ExternalOneByteStringResource but run into rust-lang/rust#119618 ie. OneByteConst is actually duplicating the vtables... which is not great. |
||
---|---|---|
.. | ||
compile_fail | ||
slots.rs | ||
test_api_entropy_source.rs | ||
test_api_flags.rs | ||
test_api.rs | ||
test_concurrent_isolate_creation_and_disposal.rs | ||
test_cppgc.rs | ||
test_platform_atomics_pump_message_loop.rs | ||
test_single_threaded_default_platform.rs | ||
test_ui.rs |