Don't crash on reference to field with erroneous type.

From-SVN: r169027
This commit is contained in:
Ian Lance Taylor 2011-01-19 20:47:21 +00:00
parent 3e03217e07
commit e76efdbd96
1 changed files with 2 additions and 0 deletions

View File

@ -9988,6 +9988,8 @@ Field_reference_expression::do_get_tree(Translate_context* context)
field = DECL_CHAIN(field);
gcc_assert(field != NULL_TREE);
}
if (TREE_TYPE(field) == error_mark_node)
return error_mark_node;
return build3(COMPONENT_REF, TREE_TYPE(field), struct_tree, field,
NULL_TREE);
}