Fixing segfault with mismatching set &default in record field.

This commit is contained in:
Robin Sommer 2013-12-18 08:36:50 -08:00
parent 207b7e7102
commit ae9e0d4cb6
5 changed files with 19 additions and 3 deletions

View file

@ -317,8 +317,9 @@ void Attributes::CheckAttr(Attr* a)
break;
// Table defaults may be promotable.
if ( (ytype->Tag() == TYPE_RECORD && atype->Tag() == TYPE_RECORD &&
record_promotion_compatible(atype->AsRecordType(), ytype->AsRecordType())) )
if ( ytype && ytype->Tag() == TYPE_RECORD &&
atype->Tag() == TYPE_RECORD &&
record_promotion_compatible(atype->AsRecordType(), ytype->AsRecordType()) )
// Ok.
break;