Commit e76efdbd by Ian Lance Taylor

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

From-SVN: r169027
parent 3e03217e
...@@ -9988,6 +9988,8 @@ Field_reference_expression::do_get_tree(Translate_context* context) ...@@ -9988,6 +9988,8 @@ Field_reference_expression::do_get_tree(Translate_context* context)
field = DECL_CHAIN(field); field = DECL_CHAIN(field);
gcc_assert(field != NULL_TREE); 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, return build3(COMPONENT_REF, TREE_TYPE(field), struct_tree, field,
NULL_TREE); NULL_TREE);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment