From fcfce1bb869fddc629e6d889d6ba1328b80b0dcf Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Fri, 25 Mar 2022 12:29:54 +0100 Subject: [PATCH] fix(ext/ffi): enforce unstable check on ops (#14115) --- .github/workflows/ci.yml | 6 +- cli/tests/integration/run_tests.rs | 90 +++++++++++++++++++++++ cli/tests/testdata/unstable_ffi_1.js | 1 + cli/tests/testdata/unstable_ffi_1.js.out | 1 + cli/tests/testdata/unstable_ffi_10.js | 1 + cli/tests/testdata/unstable_ffi_10.js.out | 1 + cli/tests/testdata/unstable_ffi_11.js | 1 + cli/tests/testdata/unstable_ffi_11.js.out | 1 + cli/tests/testdata/unstable_ffi_12.js | 1 + cli/tests/testdata/unstable_ffi_12.js.out | 1 + cli/tests/testdata/unstable_ffi_13.js | 1 + cli/tests/testdata/unstable_ffi_13.js.out | 1 + cli/tests/testdata/unstable_ffi_14.js | 1 + cli/tests/testdata/unstable_ffi_14.js.out | 1 + cli/tests/testdata/unstable_ffi_15.js | 1 + cli/tests/testdata/unstable_ffi_15.js.out | 1 + cli/tests/testdata/unstable_ffi_2.js | 10 +++ cli/tests/testdata/unstable_ffi_2.js.out | 1 + cli/tests/testdata/unstable_ffi_3.js | 10 +++ cli/tests/testdata/unstable_ffi_3.js.out | 1 + cli/tests/testdata/unstable_ffi_4.js | 1 + cli/tests/testdata/unstable_ffi_4.js.out | 1 + cli/tests/testdata/unstable_ffi_5.js | 1 + cli/tests/testdata/unstable_ffi_5.js.out | 1 + cli/tests/testdata/unstable_ffi_6.js | 1 + cli/tests/testdata/unstable_ffi_6.js.out | 1 + cli/tests/testdata/unstable_ffi_7.js | 1 + cli/tests/testdata/unstable_ffi_7.js.out | 1 + cli/tests/testdata/unstable_ffi_8.js | 1 + cli/tests/testdata/unstable_ffi_8.js.out | 1 + cli/tests/testdata/unstable_ffi_9.js | 1 + cli/tests/testdata/unstable_ffi_9.js.out | 1 + cli/tests/unit/ffi_test.ts | 51 +++++++++++++ ext/ffi/lib.rs | 62 ++++++++++++++-- 34 files changed, 249 insertions(+), 8 deletions(-) create mode 100644 cli/tests/testdata/unstable_ffi_1.js create mode 100644 cli/tests/testdata/unstable_ffi_1.js.out create mode 100644 cli/tests/testdata/unstable_ffi_10.js create mode 100644 cli/tests/testdata/unstable_ffi_10.js.out create mode 100644 cli/tests/testdata/unstable_ffi_11.js create mode 100644 cli/tests/testdata/unstable_ffi_11.js.out create mode 100644 cli/tests/testdata/unstable_ffi_12.js create mode 100644 cli/tests/testdata/unstable_ffi_12.js.out create mode 100644 cli/tests/testdata/unstable_ffi_13.js create mode 100644 cli/tests/testdata/unstable_ffi_13.js.out create mode 100644 cli/tests/testdata/unstable_ffi_14.js create mode 100644 cli/tests/testdata/unstable_ffi_14.js.out create mode 100644 cli/tests/testdata/unstable_ffi_15.js create mode 100644 cli/tests/testdata/unstable_ffi_15.js.out create mode 100644 cli/tests/testdata/unstable_ffi_2.js create mode 100644 cli/tests/testdata/unstable_ffi_2.js.out create mode 100644 cli/tests/testdata/unstable_ffi_3.js create mode 100644 cli/tests/testdata/unstable_ffi_3.js.out create mode 100644 cli/tests/testdata/unstable_ffi_4.js create mode 100644 cli/tests/testdata/unstable_ffi_4.js.out create mode 100644 cli/tests/testdata/unstable_ffi_5.js create mode 100644 cli/tests/testdata/unstable_ffi_5.js.out create mode 100644 cli/tests/testdata/unstable_ffi_6.js create mode 100644 cli/tests/testdata/unstable_ffi_6.js.out create mode 100644 cli/tests/testdata/unstable_ffi_7.js create mode 100644 cli/tests/testdata/unstable_ffi_7.js.out create mode 100644 cli/tests/testdata/unstable_ffi_8.js create mode 100644 cli/tests/testdata/unstable_ffi_8.js.out create mode 100644 cli/tests/testdata/unstable_ffi_9.js create mode 100644 cli/tests/testdata/unstable_ffi_9.js.out diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0c6a00303..113ee4db04 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -236,7 +236,7 @@ jobs: ~/.cargo/registry/index ~/.cargo/registry/cache ~/.cargo/git/db - key: 4-cargo-home-${{ matrix.os }}-${{ hashFiles('Cargo.lock') }} + key: 5-cargo-home-${{ matrix.os }}-${{ hashFiles('Cargo.lock') }} # In main branch, always creates fresh cache - name: Cache build output (main) @@ -252,7 +252,7 @@ jobs: !./target/*/*.zip !./target/*/*.tar.gz key: | - 4-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }} + 5-cargo-target-${{ matrix.os }}-${{ matrix.profile }}-${{ github.sha }} # Restore cache from the latest 'main' branch build. - name: Cache build output (PR) @@ -268,7 +268,7 @@ jobs: !./target/*/*.tar.gz key: never_saved restore-keys: | - 4-cargo-target-${{ matrix.os }}-${{ matrix.profile }}- + 5-cargo-target-${{ matrix.os }}-${{ matrix.profile }}- # Don't save cache after building PRs or branches other than 'main'. - name: Skip save cache (PR) diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index c789a33896..fb6f72c6e0 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -2523,3 +2523,93 @@ itest!(fetch_async_error_stack { output: "fetch_async_error_stack.ts.out", exit_code: 1, }); + +itest!(unstable_ffi_1 { + args: "run unstable_ffi_1.js", + output: "unstable_ffi_1.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_2 { + args: "run unstable_ffi_2.js", + output: "unstable_ffi_2.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_3 { + args: "run unstable_ffi_3.js", + output: "unstable_ffi_3.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_4 { + args: "run unstable_ffi_4.js", + output: "unstable_ffi_4.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_5 { + args: "run unstable_ffi_5.js", + output: "unstable_ffi_5.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_6 { + args: "run unstable_ffi_6.js", + output: "unstable_ffi_6.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_7 { + args: "run unstable_ffi_7.js", + output: "unstable_ffi_7.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_8 { + args: "run unstable_ffi_8.js", + output: "unstable_ffi_8.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_9 { + args: "run unstable_ffi_9.js", + output: "unstable_ffi_9.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_10 { + args: "run unstable_ffi_10.js", + output: "unstable_ffi_10.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_11 { + args: "run unstable_ffi_11.js", + output: "unstable_ffi_11.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_12 { + args: "run unstable_ffi_12.js", + output: "unstable_ffi_12.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_13 { + args: "run unstable_ffi_13.js", + output: "unstable_ffi_13.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_14 { + args: "run unstable_ffi_14.js", + output: "unstable_ffi_14.js.out", + exit_code: 70, +}); + +itest!(unstable_ffi_15 { + args: "run unstable_ffi_15.js", + output: "unstable_ffi_15.js.out", + exit_code: 70, +}); diff --git a/cli/tests/testdata/unstable_ffi_1.js b/cli/tests/testdata/unstable_ffi_1.js new file mode 100644 index 0000000000..a24a002384 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_1.js @@ -0,0 +1 @@ +Deno.core.opSync("op_ffi_load", { path: "", symbols: {} }); diff --git a/cli/tests/testdata/unstable_ffi_1.js.out b/cli/tests/testdata/unstable_ffi_1.js.out new file mode 100644 index 0000000000..7c564be8cf --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_1.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.dlopen'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_10.js b/cli/tests/testdata/unstable_ffi_10.js new file mode 100644 index 0000000000..c7cafd3ea4 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_10.js @@ -0,0 +1 @@ +Deno.core.opSync("op_ffi_read_i16", [0, 0]); diff --git a/cli/tests/testdata/unstable_ffi_10.js.out b/cli/tests/testdata/unstable_ffi_10.js.out new file mode 100644 index 0000000000..bf7e1bd4f7 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_10.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafePointerView#getInt16'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_11.js b/cli/tests/testdata/unstable_ffi_11.js new file mode 100644 index 0000000000..37bd75cc97 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_11.js @@ -0,0 +1 @@ +Deno.core.opSync("op_ffi_read_u32", [0, 0]); diff --git a/cli/tests/testdata/unstable_ffi_11.js.out b/cli/tests/testdata/unstable_ffi_11.js.out new file mode 100644 index 0000000000..2d2d72666c --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_11.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafePointerView#getUint32'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_12.js b/cli/tests/testdata/unstable_ffi_12.js new file mode 100644 index 0000000000..b05f92d393 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_12.js @@ -0,0 +1 @@ +Deno.core.opSync("op_ffi_read_i32", [0, 0]); diff --git a/cli/tests/testdata/unstable_ffi_12.js.out b/cli/tests/testdata/unstable_ffi_12.js.out new file mode 100644 index 0000000000..377d8e4a5a --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_12.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafePointerView#getInt32'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_13.js b/cli/tests/testdata/unstable_ffi_13.js new file mode 100644 index 0000000000..a83b8dc188 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_13.js @@ -0,0 +1 @@ +Deno.core.opSync("op_ffi_read_u64", [0, 0]); diff --git a/cli/tests/testdata/unstable_ffi_13.js.out b/cli/tests/testdata/unstable_ffi_13.js.out new file mode 100644 index 0000000000..6ca67a6f22 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_13.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafePointerView#getBigUint64'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_14.js b/cli/tests/testdata/unstable_ffi_14.js new file mode 100644 index 0000000000..b39b99da5f --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_14.js @@ -0,0 +1 @@ +Deno.core.opSync("op_ffi_read_f32", [0, 0]); diff --git a/cli/tests/testdata/unstable_ffi_14.js.out b/cli/tests/testdata/unstable_ffi_14.js.out new file mode 100644 index 0000000000..11fcd55806 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_14.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafePointerView#getFloat32'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_15.js b/cli/tests/testdata/unstable_ffi_15.js new file mode 100644 index 0000000000..afd49b722f --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_15.js @@ -0,0 +1 @@ +Deno.core.opSync("op_ffi_read_f64", [0, 0]); diff --git a/cli/tests/testdata/unstable_ffi_15.js.out b/cli/tests/testdata/unstable_ffi_15.js.out new file mode 100644 index 0000000000..3015e5c910 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_15.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafePointerView#getFloat64'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_2.js b/cli/tests/testdata/unstable_ffi_2.js new file mode 100644 index 0000000000..de392fa7d5 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_2.js @@ -0,0 +1,10 @@ +Deno.core.opSync("op_ffi_call_ptr", { + pointer: [0, 0], + def: { + name: null, + parameters: [], + result: "void", + }, + parameters: [], + buffers: [], +}); diff --git a/cli/tests/testdata/unstable_ffi_2.js.out b/cli/tests/testdata/unstable_ffi_2.js.out new file mode 100644 index 0000000000..cc4cc3dc69 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_2.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafeFnPointer#call'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_3.js b/cli/tests/testdata/unstable_ffi_3.js new file mode 100644 index 0000000000..4924d9d674 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_3.js @@ -0,0 +1,10 @@ +Deno.core.opAsync("op_ffi_call_ptr_nonblocking", { + pointer: [0, 0], + def: { + name: null, + parameters: [], + result: "void", + }, + parameters: [], + buffers: [], +}); diff --git a/cli/tests/testdata/unstable_ffi_3.js.out b/cli/tests/testdata/unstable_ffi_3.js.out new file mode 100644 index 0000000000..cc4cc3dc69 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_3.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafeFnPointer#call'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_4.js b/cli/tests/testdata/unstable_ffi_4.js new file mode 100644 index 0000000000..3e05bbf420 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_4.js @@ -0,0 +1 @@ +Deno.core.opSync("op_ffi_ptr_of", new Uint8Array(0)); diff --git a/cli/tests/testdata/unstable_ffi_4.js.out b/cli/tests/testdata/unstable_ffi_4.js.out new file mode 100644 index 0000000000..e0f40f2ee1 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_4.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafePointer#of'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_5.js b/cli/tests/testdata/unstable_ffi_5.js new file mode 100644 index 0000000000..447ff58427 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_5.js @@ -0,0 +1 @@ +Deno.core.opSync("op_ffi_buf_copy_into", [[0, 0], new Uint8Array(0), 0]); diff --git a/cli/tests/testdata/unstable_ffi_5.js.out b/cli/tests/testdata/unstable_ffi_5.js.out new file mode 100644 index 0000000000..e3db6af26a --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_5.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafePointerView#copyInto'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_6.js b/cli/tests/testdata/unstable_ffi_6.js new file mode 100644 index 0000000000..cc791b8f09 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_6.js @@ -0,0 +1 @@ +Deno.core.opSync("op_ffi_cstr_read", [0, 0]); diff --git a/cli/tests/testdata/unstable_ffi_6.js.out b/cli/tests/testdata/unstable_ffi_6.js.out new file mode 100644 index 0000000000..c59f51d040 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_6.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafePointerView#getCString'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_7.js b/cli/tests/testdata/unstable_ffi_7.js new file mode 100644 index 0000000000..02ef455ee4 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_7.js @@ -0,0 +1 @@ +Deno.core.opSync("op_ffi_read_u8", [0, 0]); diff --git a/cli/tests/testdata/unstable_ffi_7.js.out b/cli/tests/testdata/unstable_ffi_7.js.out new file mode 100644 index 0000000000..6ab413537d --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_7.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafePointerView#getUint8'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_8.js b/cli/tests/testdata/unstable_ffi_8.js new file mode 100644 index 0000000000..d250c9f219 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_8.js @@ -0,0 +1 @@ +Deno.core.opSync("op_ffi_read_i8", [0, 0]); diff --git a/cli/tests/testdata/unstable_ffi_8.js.out b/cli/tests/testdata/unstable_ffi_8.js.out new file mode 100644 index 0000000000..338db26319 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_8.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafePointerView#getInt8'. The --unstable flag must be provided. diff --git a/cli/tests/testdata/unstable_ffi_9.js b/cli/tests/testdata/unstable_ffi_9.js new file mode 100644 index 0000000000..f21a4cdbf2 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_9.js @@ -0,0 +1 @@ +Deno.core.opSync("op_ffi_read_u16", [0, 0]); diff --git a/cli/tests/testdata/unstable_ffi_9.js.out b/cli/tests/testdata/unstable_ffi_9.js.out new file mode 100644 index 0000000000..fb6d75f145 --- /dev/null +++ b/cli/tests/testdata/unstable_ffi_9.js.out @@ -0,0 +1 @@ +Unstable API 'Deno.UnsafePointerView#getUint16'. The --unstable flag must be provided. diff --git a/cli/tests/unit/ffi_test.ts b/cli/tests/unit/ffi_test.ts index b7772e8e24..22da88d27a 100644 --- a/cli/tests/unit/ffi_test.ts +++ b/cli/tests/unit/ffi_test.ts @@ -23,3 +23,54 @@ Deno.test({ permissions: { ffi: true } }, function dlopenInvalidArguments() { Deno.dlopen(filename); }, TypeError); }); + +Deno.test({ permissions: { ffi: false } }, function ffiPermissionDenied() { + assertThrows(() => { + Deno.dlopen("/usr/lib/libc.so.6", {}); + }, Deno.errors.PermissionDenied); + const ptr = new Deno.UnsafePointer(0n); + const fnptr = new Deno.UnsafeFnPointer( + ptr, + { + parameters: ["u32", "pointer"], + result: "void", + } as const, + ); + assertThrows(() => { + fnptr.call(123, null); + }, Deno.errors.PermissionDenied); + assertThrows(() => { + Deno.UnsafePointer.of(new Uint8Array(0)); + }, Deno.errors.PermissionDenied); + const ptrView = new Deno.UnsafePointerView(ptr); + assertThrows(() => { + ptrView.copyInto(new Uint8Array(0)); + }, Deno.errors.PermissionDenied); + assertThrows(() => { + ptrView.getCString(); + }, Deno.errors.PermissionDenied); + assertThrows(() => { + ptrView.getUint8(); + }, Deno.errors.PermissionDenied); + assertThrows(() => { + ptrView.getInt8(); + }, Deno.errors.PermissionDenied); + assertThrows(() => { + ptrView.getUint16(); + }, Deno.errors.PermissionDenied); + assertThrows(() => { + ptrView.getInt16(); + }, Deno.errors.PermissionDenied); + assertThrows(() => { + ptrView.getUint32(); + }, Deno.errors.PermissionDenied); + assertThrows(() => { + ptrView.getInt32(); + }, Deno.errors.PermissionDenied); + assertThrows(() => { + ptrView.getFloat32(); + }, Deno.errors.PermissionDenied); + assertThrows(() => { + ptrView.getFloat64(); + }, Deno.errors.PermissionDenied); +}); diff --git a/ext/ffi/lib.rs b/ext/ffi/lib.rs index 6ddeee51c8..01aa17698f 100644 --- a/ext/ffi/lib.rs +++ b/ext/ffi/lib.rs @@ -45,6 +45,11 @@ fn check_unstable(state: &OpState, api_name: &str) { } } +pub fn check_unstable2(state: &Rc>, api_name: &str) { + let state = state.borrow(); + check_unstable(&state, api_name) +} + pub trait FfiPermissions { fn check(&mut self, path: Option<&Path>) -> Result<(), AnyError>; } @@ -144,8 +149,8 @@ pub fn init(unstable: bool) -> Extension { op_ffi_get_static::decl(), op_ffi_call::decl(), op_ffi_call_nonblocking::decl(), - op_ffi_call_ptr::decl(), - op_ffi_call_ptr_nonblocking::decl(), + op_ffi_call_ptr::decl::

(), + op_ffi_call_ptr_nonblocking::decl::

(), op_ffi_ptr_of::decl::

(), op_ffi_buf_copy_into::decl::

(), op_ffi_cstr_read::decl::

(), @@ -648,15 +653,38 @@ fn ffi_call(args: FfiCallArgs, symbol: &Symbol) -> Result { } #[op] -fn op_ffi_call_ptr(args: FfiCallPtrArgs) -> Result { +fn op_ffi_call_ptr( + state: &mut deno_core::OpState, + args: FfiCallPtrArgs, +) -> Result +where + FP: FfiPermissions + 'static, +{ + check_unstable(state, "Deno.UnsafeFnPointer#call"); + + let permissions = state.borrow_mut::(); + permissions.check(None)?; + let symbol = args.get_symbol(); ffi_call(args.into(), &symbol) } #[op] -async fn op_ffi_call_ptr_nonblocking( +async fn op_ffi_call_ptr_nonblocking( + state: Rc>, args: FfiCallPtrArgs, -) -> Result { +) -> Result +where + FP: FfiPermissions + 'static, +{ + check_unstable2(&state, "Deno.UnsafeFnPointer#call"); + + { + let mut state = state.borrow_mut(); + let permissions = state.borrow_mut::(); + permissions.check(None)?; + } + let symbol = args.get_symbol(); tokio::task::spawn_blocking(move || ffi_call(args.into(), &symbol)) .await @@ -774,6 +802,8 @@ fn op_ffi_ptr_of( where FP: FfiPermissions + 'static, { + check_unstable(state, "Deno.UnsafePointer#of"); + let permissions = state.borrow_mut::(); permissions.check(None)?; @@ -788,6 +818,8 @@ fn op_ffi_buf_copy_into( where FP: FfiPermissions + 'static, { + check_unstable(state, "Deno.UnsafePointerView#copyInto"); + let permissions = state.borrow_mut::(); permissions.check(None)?; @@ -810,6 +842,8 @@ fn op_ffi_cstr_read( where FP: FfiPermissions + 'static, { + check_unstable(state, "Deno.UnsafePointerView#getCString"); + let permissions = state.borrow_mut::(); permissions.check(None)?; @@ -825,6 +859,8 @@ fn op_ffi_read_u8( where FP: FfiPermissions + 'static, { + check_unstable(state, "Deno.UnsafePointerView#getUint8"); + let permissions = state.borrow_mut::(); permissions.check(None)?; @@ -839,6 +875,8 @@ fn op_ffi_read_i8( where FP: FfiPermissions + 'static, { + check_unstable(state, "Deno.UnsafePointerView#getInt8"); + let permissions = state.borrow_mut::(); permissions.check(None)?; @@ -853,6 +891,8 @@ fn op_ffi_read_u16( where FP: FfiPermissions + 'static, { + check_unstable(state, "Deno.UnsafePointerView#getUint16"); + let permissions = state.borrow_mut::(); permissions.check(None)?; @@ -867,6 +907,8 @@ fn op_ffi_read_i16( where FP: FfiPermissions + 'static, { + check_unstable(state, "Deno.UnsafePointerView#getInt16"); + let permissions = state.borrow_mut::(); permissions.check(None)?; @@ -881,6 +923,8 @@ fn op_ffi_read_u32( where FP: FfiPermissions + 'static, { + check_unstable(state, "Deno.UnsafePointerView#getUint32"); + let permissions = state.borrow_mut::(); permissions.check(None)?; @@ -895,6 +939,8 @@ fn op_ffi_read_i32( where FP: FfiPermissions + 'static, { + check_unstable(state, "Deno.UnsafePointerView#getInt32"); + let permissions = state.borrow_mut::(); permissions.check(None)?; @@ -909,6 +955,8 @@ fn op_ffi_read_u64( where FP: FfiPermissions + 'static, { + check_unstable(state, "Deno.UnsafePointerView#getBigUint64"); + let permissions = state.borrow_mut::(); permissions.check(None)?; @@ -925,6 +973,8 @@ fn op_ffi_read_f32( where FP: FfiPermissions + 'static, { + check_unstable(state, "Deno.UnsafePointerView#getFloat32"); + let permissions = state.borrow_mut::(); permissions.check(None)?; @@ -939,6 +989,8 @@ fn op_ffi_read_f64( where FP: FfiPermissions + 'static, { + check_unstable(state, "Deno.UnsafePointerView#getFloat64"); + let permissions = state.borrow_mut::(); permissions.check(None)?;