From 3b5c4de0cf93667ffc98f112db7dcbea92292e32 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 15 Mar 2021 06:23:12 -0600 Subject: Call ada_ensure_varsize_limit in indirection Internal testing revealed yet another Ada regression from the expression rewrite. In this case, indirection did not use the Ada varsize limit. The old code relied on the expression resolution process to evaluate this subexpression with EVAL_AVOID_SIDE_EFFECTS in order to get this error. However, this isn't always done in the new approach; so this patch introduces another call to ada_ensure_varsize_limit in the appropriate spot. As with the earlier patches, this path was not tested in-tree, so this patch also updates a test. gdb/ChangeLog 2021-03-15 Tom Tromey * ada-lang.c (ada_unop_ind_operation::evaluate): Call ada_ensure_varsize_limit. gdb/testsuite/ChangeLog 2021-03-15 Tom Tromey * gdb.ada/varsize_limit.exp: Add new test. * gdb.ada/varsize_limit/vsizelim.adb: Update. --- gdb/ada-lang.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gdb/ada-lang.c') diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index a74f540..1fc303a 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -10480,6 +10480,11 @@ ada_unop_ind_operation::evaluate (struct type *expect_type, (CORE_ADDR) value_as_address (arg1)); } + struct type *target_type = (to_static_fixed_type + (ada_aligned_type + (ada_check_typedef (TYPE_TARGET_TYPE (type))))); + ada_ensure_varsize_limit (target_type); + if (ada_is_array_descriptor_type (type)) /* GDB allows dereferencing GNAT array descriptors. */ return ada_coerce_to_simple_array (arg1); -- cgit v1.1