File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -6588,7 +6588,11 @@ Builtin_call_expression::Builtin_call_expression(Gogo* gogo,
6588
6588
recover_arg_is_set_(false )
6589
6589
{
6590
6590
Func_expression* fnexp = this ->fn ()->func_expression ();
6591
- go_assert (fnexp != NULL );
6591
+ if (fnexp == NULL )
6592
+ {
6593
+ this ->code_ = BUILTIN_INVALID;
6594
+ return ;
6595
+ }
6592
6596
const std::string& name (fnexp->named_object ()->name ());
6593
6597
if (name == " append" )
6594
6598
this ->code_ = BUILTIN_APPEND;
@@ -6661,7 +6665,7 @@ Expression*
6661
6665
Builtin_call_expression::do_lower (Gogo* gogo, Named_object* function,
6662
6666
Statement_inserter* inserter, int )
6663
6667
{
6664
- if (this ->classification () == EXPRESSION_ERROR )
6668
+ if (this ->is_error_expression () )
6665
6669
return this ;
6666
6670
6667
6671
Location loc = this ->location ();
@@ -7500,11 +7504,13 @@ Builtin_call_expression::do_discarding_value()
7500
7504
Type*
7501
7505
Builtin_call_expression::do_type ()
7502
7506
{
7507
+ if (this ->is_error_expression ())
7508
+ return Type::make_error_type ();
7503
7509
switch (this ->code_ )
7504
7510
{
7505
7511
case BUILTIN_INVALID:
7506
7512
default :
7507
- go_unreachable ();
7513
+ return Type::make_error_type ();
7508
7514
7509
7515
case BUILTIN_NEW:
7510
7516
case BUILTIN_MAKE:
You can’t perform that action at this time.
0 commit comments