From 3ad8bd85578146f1bb0ce61912b6d6e9991a43c7 Mon Sep 17 00:00:00 2001 From: Aapo Alasuutari Date: Wed, 29 Jun 2022 18:00:29 +0300 Subject: fix(ext/ffi): Empty buffers error with index out of bounds on FFI (#14997) --- test_ffi/tests/test.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test_ffi/tests/test.js') diff --git a/test_ffi/tests/test.js b/test_ffi/tests/test.js index 03c166a7c..af2f522a6 100644 --- a/test_ffi/tests/test.js +++ b/test_ffi/tests/test.js @@ -214,6 +214,10 @@ console.log(stringPtrview.getCString(11)); console.log(Boolean(dylib.symbols.is_null_ptr(ptr0))); console.log(Boolean(dylib.symbols.is_null_ptr(null))); console.log(Boolean(dylib.symbols.is_null_ptr(Deno.UnsafePointer.of(into)))); +const emptyBuffer = new BigUint64Array(0); +console.log(Boolean(dylib.symbols.is_null_ptr(emptyBuffer))); +const emptySlice = into.subarray(6); +console.log(Boolean(dylib.symbols.is_null_ptr(emptySlice))); const addU32Ptr = dylib.symbols.get_add_u32_ptr(); const addU32 = new Deno.UnsafeFnPointer(addU32Ptr, { -- cgit v1.2.3