diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 88801ac..1fbf69a 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1103,10 +1103,12 @@ create_array_type_with_stride (struct type *result_type, if (high_bound < low_bound) TYPE_LENGTH (result_type) = 0; else if (byte_stride > 0) - TYPE_LENGTH (result_type) = byte_stride * (high_bound - low_bound + 1); + TYPE_LENGTH (result_type) = (byte_stride * (high_bound - low_bound) + + TYPE_LENGTH (element_type)); else if (bit_stride > 0) TYPE_LENGTH (result_type) = - (bit_stride * (high_bound - low_bound + 1) + 7) / 8; + ((bit_stride * (high_bound - low_bound) + 7) / 8 + + TYPE_LENGTH (element_type)); else TYPE_LENGTH (result_type) = TYPE_LENGTH (element_type) * (high_bound - low_bound + 1);