Joel Brobecker (brobecker@adacore.com): > > 2008-11-27 Jerome Guitton > > > > * ada-lang.c (ada_template_to_fixed_record_type_1): Check size > > of type to guard against a crash. > > Jerome and I just discussed this patch today, and we think we may > have a better solution. Standby... Right. It is possible to rewrite ada_template_to_fixed_record_type_1 to avoid the crash; the discriminant value is allocated using the type being built; the crash may happen when a bogus dynamic field is included to this partial type. The trick is to allocate the value before any of these dynamic fields is added to the partial type. When we encounter a dynamic field, all the discriminant fields have already been added, so it should be fine. Here is the new patch, tested on linux. OK to apply? 2008-12-12 Jerome Guitton * ada-lang.c (ada_template_to_fixed_record_type_1): Allocate dval before a dynamic field is added.