compiler: Mark builtin calls with bad types as errors.
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 31 Mar 2015 00:10:46 +0000 (00:10 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 31 Mar 2015 00:10:46 +0000 (00:10 +0000)
Fixes golang/go/#10285.

From-SVN: r221782

gcc/go/gofrontend/expressions.cc

index 0cb0938fda1e8005b3f143f1ad8df14226b91c6b..40d9aa7726bf5cf38e1cb330aebb37a14e9a77f0 100644 (file)
@@ -7959,7 +7959,10 @@ Builtin_call_expression::do_check_types(Gogo*)
        Type* arg1_type = args->front()->type();
        Type* arg2_type = args->back()->type();
        if (arg1_type->is_error() || arg2_type->is_error())
-         break;
+         {
+           this->set_is_error();
+           break;
+         }
 
        Type* e1;
        if (arg1_type->is_slice_type())
@@ -8001,7 +8004,10 @@ Builtin_call_expression::do_check_types(Gogo*)
          }
        if (args->front()->type()->is_error()
            || args->back()->type()->is_error())
-         break;
+         {
+           this->set_is_error();
+           break;
+         }
 
        Array_type* at = args->front()->type()->array_type();
        Type* e = at->element_type();