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 | eae9d42156544b68e1b3217a3e907867d5c11fd3 (patch) | |
tree | 36b2c3a34a33252829f73f326c92300171f811cc | |
parent | 99bb6596a8ad310cd8751b055ad38b95031a1f44 (diff) | |
download | txr-eae9d42156544b68e1b3217a3e907867d5c11fd3.tar.gz txr-eae9d42156544b68e1b3217a3e907867d5c11fd3.tar.bz2 txr-eae9d42156544b68e1b3217a3e907867d5c11fd3.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); |