Commit ecdacbb3 by Ian Lance Taylor

Don't crash on invalid type conversion.

From-SVN: r168161
parent 8dcfef8f
......@@ -3242,6 +3242,18 @@ Type_conversion_expression::do_check_types(Gogo*)
Type* expr_type = this->expr_->type();
std::string reason;
if (type->is_error_type()
|| type->is_undefined()
|| expr_type->is_error_type()
|| expr_type->is_undefined())
{
// Make sure we emit an error for an undefined type.
type->base();
expr_type->base();
this->set_is_error();
return;
}
if (this->may_convert_function_types_
&& type->function_type() != NULL
&& expr_type->function_type() != NULL)
......
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