* ada-lang.c (ada_template_to_fixed_record_type_1): Check size
of type to guard against a crash.
This commit is contained in:
parent
e94345ae49
commit
b530497149
2 changed files with 14 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2008-02-04 Jerome Guitton <guitton@adacore.com>
|
||||||
|
|
||||||
|
* ada-lang.c (ada_template_to_fixed_record_type_1): Check size
|
||||||
|
of type to guard against a crash.
|
||||||
|
|
||||||
2009-02-04 Jerome Guitton <guitton@adacore.com>
|
2009-02-04 Jerome Guitton <guitton@adacore.com>
|
||||||
|
|
||||||
* value.c (value_from_contents_and_address): Always return
|
* value.c (value_from_contents_and_address): Always return
|
||||||
|
|
|
@ -6877,7 +6877,15 @@ ada_template_to_fixed_record_type_1 (struct type *type,
|
||||||
else if (is_dynamic_field (type, f))
|
else if (is_dynamic_field (type, f))
|
||||||
{
|
{
|
||||||
if (dval0 == NULL)
|
if (dval0 == NULL)
|
||||||
|
{
|
||||||
|
/* rtype's length is computed based on the run-time
|
||||||
|
value of discriminants. If the discriminants are not
|
||||||
|
initialized, the type size may be completely bogus and
|
||||||
|
GDB may fail to allocate a value for it. So check the
|
||||||
|
size first before creating the value. */
|
||||||
|
check_size (rtype);
|
||||||
dval = value_from_contents_and_address (rtype, valaddr, address);
|
dval = value_from_contents_and_address (rtype, valaddr, address);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
dval = dval0;
|
dval = dval0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue