compiler: avoid a couple of compiler crashes

These came up while building 1.14beta1 while the code was still invalid.
The policy is to not bother committing invalid test cases that cause
compiler crashes.

Change-Id: Ic97e184f9ed9172a95aae1a5b9c01855798e27cc
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/213537
Reviewed-by: Than McIntosh <thanm@google.com>
diff --git a/go/expressions.cc b/go/expressions.cc
index ecb28e0..8d72b1f 100644
--- a/go/expressions.cc
+++ b/go/expressions.cc
@@ -11766,10 +11766,17 @@
   Typed_identifier_list::const_iterator pp = fntype->parameters()->begin();
   bool is_interface_method =
     this->fn_->interface_field_reference_expression() != NULL;
+  size_t argcount = this->args_->size();
   if (!is_interface_method && fntype->is_method())
     {
       // Skip the receiver argument, which cannot be interface.
       pa++;
+      argcount--;
+    }
+  if (argcount != fntype->parameters()->size())
+    {
+      go_assert(saw_errors());
+      return;
     }
   for (; pa != this->args_->end(); ++pa, ++pp)
     {
@@ -11895,6 +11902,8 @@
 Type*
 Call_expression::do_type()
 {
+  if (this->is_error_expression())
+    return Type::make_error_type();
   if (this->type_ != NULL)
     return this->type_;