From 90c03812720c328dcb68939400b265128b6eca8f Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Sat, 14 Jan 2023 23:40:01 -0800 Subject: fix(ops): disallow memory slices as inputs to async ops (#16738) In Rust, it is UB if a slice is mutated while borrowed except through the slice itself, and it is also UB if a mutable slice is read while borrowed. The op macro allows borrowing an `ArrayBuffer{,View}` as a memory slice for the duration of an op, but this is not sound for async ops, since the `ArrayBuffer` could be accessed from JS during the await points. This PR therefore disallows such automatic borrowing only for async ops. Co-authored-by: Divy Srivastava --- ops/optimizer_tests/async_result.expected | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ops/optimizer_tests/async_result.expected') diff --git a/ops/optimizer_tests/async_result.expected b/ops/optimizer_tests/async_result.expected index be2e79ac0..87d46977d 100644 --- a/ops/optimizer_tests/async_result.expected +++ b/ops/optimizer_tests/async_result.expected @@ -3,9 +3,9 @@ returns_result: true has_ref_opstate: false has_rc_opstate: true has_fast_callback_option: false -needs_fast_callback_option: true +needs_fast_callback_option: false fast_result: None -fast_parameters: [V8Value, I32, U32, Uint8Array] -transforms: {2: Transform { kind: SliceU8(true), index: 2 }} +fast_parameters: [V8Value, I32, U32] +transforms: {} is_async: true fast_compatible: true -- cgit v1.2.3