Don't crash on defer of type conversion.
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 15 Feb 2011 19:41:29 +0000 (19:41 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 15 Feb 2011 19:41:29 +0000 (19:41 +0000)
From-SVN: r170196

gcc/go/gofrontend/statements.cc

index bae4be8e31be16428ed23cf1efd386a94a5c3cc4..268c7284c4da64b79e71711793bffcf87d60d196 100644 (file)
@@ -1778,10 +1778,7 @@ Thunk_statement::do_determine_types()
   // pass parameters.
   Call_expression* ce = this->call_->call_expression();
   if (ce == NULL)
-    {
-      gcc_assert(this->call_->is_error_expression());
-      return;
-    }
+    return;
   Function_type* fntype = ce->get_function_type();
   if (fntype != NULL && !this->is_simple(fntype))
     this->struct_type_ = this->build_struct(fntype);
@@ -1795,7 +1792,8 @@ Thunk_statement::do_check_types(Gogo*)
   Call_expression* ce = this->call_->call_expression();
   if (ce == NULL)
     {
-      gcc_assert(this->call_->is_error_expression());
+      if (!this->call_->is_error_expression())
+       this->report_error("expected call expression");
       return;
     }
   Function_type* fntype = ce->get_function_type();