Check index in type::field
authorTom Tromey <tromey@adacore.com>
Mon, 18 Oct 2021 18:32:18 +0000 (12:32 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 19 Oct 2021 19:30:59 +0000 (13:30 -0600)
commit5a8edb756a56cdfb563006cbc39561994acf6d2d
tree58e9c09bd17adc4f1dcde2868f8b3c8c7478b21b
parent775d36a916c1be042ceb67fc6ea22f53a9f5e331
Check index in type::field

This changes gdb to check the index that is passed to type::field.
This caught one bug in the Ada code when running the test suite
(actually I found the bug first, then realized that the check would
have helped), so this patch fixes that as well.

Regression tested on x86-64 Fedora 34.
gdb/ada-lang.c
gdb/gdbtypes.c
gdb/gdbtypes.h