diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-07-21 07:17:26 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-07-21 07:17:26 -0700 |
commit | 4c760c3b98fb4f0375b61b7b41e2c58bfca5fb59 (patch) | |
tree | 36b2c3a34a33252829f73f326c92300171f811cc | |
parent | 16ea370778dcd9943fb11767992aebf6263acfd4 (diff) | |
download | txr-4c760c3b98fb4f0375b61b7b41e2c58bfca5fb59.tar.gz txr-4c760c3b98fb4f0375b61b7b41e2c58bfca5fb59.tar.bz2 txr-4c760c3b98fb4f0375b61b7b41e2c58bfca5fb59.zip |
carray: add missing argument type checking.
* ffi.c (carray_uint, carray_int): We must use
ffi_type_struct_checked here, otherwise we are blindly
assuming that the element type is a FFI type.
-rw-r--r-- | ffi.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -5922,7 +5922,7 @@ val carray_uint(val num, val eltype_in) { val self = lit("carray-uint"); val eltype = default_arg(eltype_in, ffi_type_compile(uchar_s)); - struct txr_ffi_type *tft = ffi_type_struct(eltype); + struct txr_ffi_type *tft = ffi_type_struct_checked(self, eltype); carray_elem_check(tft, self); @@ -5957,7 +5957,7 @@ val carray_int(val num, val eltype_in) { val self = lit("carray-int"); val eltype = default_arg(eltype_in, ffi_type_compile(uchar_s)); - struct txr_ffi_type *tft = ffi_type_struct(eltype); + struct txr_ffi_type *tft = ffi_type_struct_checked(self, eltype); carray_elem_check(tft, self); |