Jerome Guitton (guitton@adacore.com): > First fix for the test failure mentioned in: > http://sourceware.org/ml/gdb-patches/2008-11/msg00718.html > > ada_template_to_fixed_record_type_1 builds a fixed-size record type > from the run-time values of its discriminants. If the record contains > dynamic field, and if its discriminants are not initialized, the type > may end up to be unreasonably big and GDB may fail to allocate a value > of this type. This patch adds a check for such a case. Summary of this thread: I first submitted a patch to guard against the malloc failure, and then I thought that there was a way to change the algorithm in order to avoid this check_size guard. Unfortunately, it appears that there are cases that my new algorithm that does not handle. So back to the original patch. The new call to check_size is not such a big deal after all; the built type size is checked at the end of the function anyway. 2008-02-04 Jerome Guitton * ada-lang.c (ada_template_to_fixed_record_type_1): Check size of type to guard against a crash. OK to apply?