diff options
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/ada-lang.c | 9 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5d55356..9e71836 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2020-07-30 Simon Marchi <simon.marchi@polymtl.ca> + + PR ada/26318 + * ada-lang.c (ada_modulus): Return 0 if property is not of const + kind. + 2020-07-30 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * breakpoint.c (set_breakpoint_condition): Do minor refactoring. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 2be3fe4..2995152 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -11452,7 +11452,14 @@ ada_is_modular_type (struct type *type) ULONGEST ada_modulus (struct type *type) { - return (ULONGEST) type->bounds ()->high.const_val () + 1; + const dynamic_prop &high = type->bounds ()->high; + + if (high.kind () == PROP_CONST) + return (ULONGEST) high.const_val () + 1; + + /* If TYPE is unresolved, the high bound might be a location list. Return + 0, for lack of a better value to return. */ + return 0; } |