A recent upstream patch of mine caused a regression in aggregate
assignment. The bug was that add_component_interval didn't properly
update the array contents in one resize case.
I found furthermore that there was no test case that would provoke
this failure. This patch fixes the bug and introduces a test.
gdb/ChangeLog
2021-01-07 Tom Tromey <tromey@adacore.com>
* ada-lang.c (add_component_interval): Start loop using vector's
updated size.
gdb/testsuite/ChangeLog
2021-01-07 Tom Tromey <tromey@adacore.com>
* gdb.ada/assign_arr.exp: Add 'others' test.
+2021-01-07 Tom Tromey <tromey@adacore.com>
+
+ * ada-lang.c (add_component_interval): Start loop using vector's
+ updated size.
+
2021-01-06 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_evaluate_subexp) <BINOP_ADD, BINOP_SUB>:
}
indices.resize (indices.size () + 2);
- for (j = size - 1; j >= i + 2; j -= 1)
+ for (j = indices.size () - 1; j >= i + 2; j -= 1)
indices[j] = indices[j - 2];
indices[i] = low;
indices[i + 1] = high;
+2021-01-07 Tom Tromey <tromey@adacore.com>
+
+ * gdb.ada/assign_arr.exp: Add 'others' test.
+
2021-01-06 Tom Tromey <tromey@adacore.com>
* gdb.ada/fixed_points/pck.ads (Delta4): New constant.
gdb_test "print assign_arr_input.u2 :=(0.25,0.5,0.75)" \
" = \\(0\\.25, 0\\.5, 0\\.75\\)"
+
+gdb_test "print assign_arr_input.u2 :=(0.25, others => 0.125)" \
+ " = \\(0\\.25, 0\\.125, 0\\.125\\)"