deno
39c22a20 - fix(ffi): reject resizable buffers in nonblocking calls (#36259)

Commit
52 days ago
fix(ffi): reject resizable buffers in nonblocking calls (#36259) ## Summary - validate retained V8 backing stores before dispatching nonblocking FFI calls - reject user-resizable stores for buffer arguments, struct arguments, and result storage - preserve synchronous FFI behavior and fixed-buffer support ## Background Nonblocking FFI calls retain a backing-store reference and pass its data pointer to a worker thread. The reference keeps the backing-store object alive, but a user-resizable store can still change its data pointer after the call is dispatched. The nonblocking path now accepts only fixed backing stores before retaining and forwarding their pointers. This applies consistently to direct `ArrayBuffer` values, views, nested struct inputs, and the internal storage used for struct results. ## Tests - `cargo test -p deno_ffi` - `cargo build -p deno -p test_server -p test_ffi` - `cargo test -p integration_tests --test integration ffi::ffi_basic` - `cargo clippy -p deno_ffi --all-targets -- -D warnings` - `./tools/format.js ext/ffi/ir.rs ext/ffi/call.rs tests/ffi/testdata/test.js`
Author
Parents
Loading