]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compiler: propagate array length error marker farther
authorIan Lance Taylor <iant@golang.org>
Sun, 3 Jul 2022 21:37:23 +0000 (14:37 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 6 Jul 2022 00:11:05 +0000 (17:11 -0700)
Fixes golang/go#53639

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/415936

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/types.cc

index 461e2fdf271548220fa305c024834059da5750fc..7c5c45672d78ea45fc49d1073a696eb528d52440 100644 (file)
@@ -1,4 +1,4 @@
-a209dca9ec918535977dcab99fd9bb60986ffacd
+d295a0a2c96c0f7c3abd94fea3aa4e2303bf2af2
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 00d35a965a91f9ea1d7ee2fef55e60d727554d95..2492d9fe73526a76dbbff5001b055b45a319dc32 100644 (file)
@@ -8486,6 +8486,11 @@ Builtin_call_expression::do_flatten(Gogo* gogo, Named_object* function,
             pa != this->args()->end();
             ++pa)
          {
+           if ((*pa)->is_error_expression())
+             {
+               go_assert(saw_errors());
+               return Expression::make_error(loc);
+             }
            if ((*pa)->is_nil_expression())
              {
                Expression* nil = Expression::make_nil(loc);
@@ -13391,6 +13396,7 @@ Array_index_expression::do_check_types(Gogo*)
   if (array_type == NULL)
     {
       go_assert(this->array_->type()->is_error());
+      this->set_is_error();
       return;
     }
 
index 4995283bb60385e0696c556d57438b870fa7b0fa..9f34801f6950e353da550d07ca8d01d56b1cbbfd 100644 (file)
@@ -7429,7 +7429,10 @@ bool
 Array_type::do_verify()
 {
   if (this->element_type()->is_error_type())
-    return false;
+    {
+      this->set_is_error();
+      return false;
+    }
   if (!this->verify_length())
     {
       this->length_ = Expression::make_error(this->length_->location());