Don't crash if erroneous type was not converted.

From-SVN: r170646
This commit is contained in:
Ian Lance Taylor 2011-03-03 06:50:32 +00:00
parent e2e280a3e5
commit f7a10f0d78
1 changed files with 6 additions and 1 deletions

View File

@ -7300,7 +7300,12 @@ Named_type::do_get_tree(Gogo* gogo)
// We are not converting types. This should only be called if the
// type has already been converted.
gcc_assert(this->is_converted_);
if (!this->is_converted_)
{
gcc_assert(saw_errors());
return error_mark_node;
}
gcc_assert(t != NULL_TREE && TYPE_SIZE(t) != NULL_TREE);
// Complete the tree.