Commit c7f4431d by Ian Lance Taylor

Don't crash on erroneous thunk.

From-SVN: r170031
parent 4a299bf4
...@@ -1776,8 +1776,13 @@ Thunk_statement::do_determine_types() ...@@ -1776,8 +1776,13 @@ Thunk_statement::do_determine_types()
// Now that we know the types of the call, build the struct used to // Now that we know the types of the call, build the struct used to
// pass parameters. // pass parameters.
Function_type* fntype = Call_expression* ce = this->call_->call_expression();
this->call_->call_expression()->get_function_type(); if (ce == NULL)
{
gcc_assert(this->call_->is_error_expression());
return;
}
Function_type* fntype = ce->get_function_type();
if (fntype != NULL && !this->is_simple(fntype)) if (fntype != NULL && !this->is_simple(fntype))
this->struct_type_ = this->build_struct(fntype); this->struct_type_ = this->build_struct(fntype);
} }
...@@ -1788,6 +1793,11 @@ void ...@@ -1788,6 +1793,11 @@ void
Thunk_statement::do_check_types(Gogo*) Thunk_statement::do_check_types(Gogo*)
{ {
Call_expression* ce = this->call_->call_expression(); Call_expression* ce = this->call_->call_expression();
if (ce == NULL)
{
gcc_assert(this->call_->is_error_expression());
return;
}
Function_type* fntype = ce->get_function_type(); Function_type* fntype = ce->get_function_type();
if (fntype != NULL && fntype->is_method()) if (fntype != NULL && fntype->is_method())
{ {
......
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