From b90e4a97419ce91fd7c1628b5912e8f54bee3441 Mon Sep 17 00:00:00 2001 From: Jerry DeLisle Date: Fri, 15 Jan 2021 13:48:42 -0800 Subject: fortran: Fixes a bug in ISO_Fortran_binding.c. libgfortran/ChangeLog: * runtime/ISO_Fortran_binding.c (CFI_establish): Fixed signed char arrays. Signed char or uint8_t arrays would cause crashes unless an element size is specified. gcc/testsuite/ChangeLog: * gfortran.dg/iso_fortran_binding_uint8_array.f90: New test. * gfortran.dg/iso_fortran_binding_uint8_array_driver.c: New test. --- libgfortran/runtime/ISO_Fortran_binding.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libgfortran/runtime') diff --git a/libgfortran/runtime/ISO_Fortran_binding.c b/libgfortran/runtime/ISO_Fortran_binding.c index 86ff25a..3746ec1 100644 --- a/libgfortran/runtime/ISO_Fortran_binding.c +++ b/libgfortran/runtime/ISO_Fortran_binding.c @@ -345,8 +345,7 @@ int CFI_establish (CFI_cdesc_t *dv, void *base_addr, CFI_attribute_t attribute, dv->base_addr = base_addr; if (type == CFI_type_char || type == CFI_type_ucs4_char || - type == CFI_type_signed_char || type == CFI_type_struct || - type == CFI_type_other) + type == CFI_type_struct || type == CFI_type_other) dv->elem_len = elem_len; else { -- cgit v1.1