summaryrefslogtreecommitdiff
path: root/test_ffi/tests
diff options
context:
space:
mode:
authorAapo Alasuutari <aapo.alasuutari@gmail.com>2022-06-29 18:00:29 +0300
committerGitHub <noreply@github.com>2022-06-29 20:30:29 +0530
commit3ad8bd85578146f1bb0ce61912b6d6e9991a43c7 (patch)
treedb9316f470d09374c88b4a3bbb9a4f28bf441078 /test_ffi/tests
parent6743b3227b21d2814380253f8e8a0e2c116fb0f7 (diff)
fix(ext/ffi): Empty buffers error with index out of bounds on FFI (#14997)
Diffstat (limited to 'test_ffi/tests')
-rw-r--r--test_ffi/tests/integration_tests.rs2
-rw-r--r--test_ffi/tests/test.js4
2 files changed, 6 insertions, 0 deletions
diff --git a/test_ffi/tests/integration_tests.rs b/test_ffi/tests/integration_tests.rs
index 35f37aa14..5ca430f43 100644
--- a/test_ffi/tests/integration_tests.rs
+++ b/test_ffi/tests/integration_tests.rs
@@ -56,6 +56,8 @@ fn basic() {
false\n\
true\n\
false\n\
+ false\n\
+ false\n\
579\n\
true\n\
579\n\
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, {