diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 567cc002d6..ca8c5dfaf1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2017-11-29 Joel Brobecker + + * ada-lang.c (to_fixed_range_type): Make sure that the size + of the range type being returned is the same as the size + of the range type being fixed. + 2017-11-29 Pedro Alves PR c++/19436 diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 38d1ce6cf6..8e35ee6205 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -11688,6 +11688,10 @@ to_fixed_range_type (struct type *raw_type, struct value *dval) type = create_static_range_type (alloc_type_copy (raw_type), base_type, L, U); + /* create_static_range_type alters the resulting type's length + to match the size of the base_type, which is not what we want. + Set it back to the original range type's length. */ + TYPE_LENGTH (type) = TYPE_LENGTH (raw_type); TYPE_NAME (type) = name; return type; }