]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compiler: determine types of Slice_{value,info} expressions
authorIan Lance Taylor <iant@golang.org>
Wed, 21 Jun 2023 21:27:02 +0000 (14:27 -0700)
committerIan Lance Taylor <iant@golang.org>
Thu, 22 Jun 2023 00:52:47 +0000 (17:52 -0700)
This fixes an accidental omission in the determine types pass.

Test case is https://go.dev/cl/505015.

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

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

index dbb2d68f90919fb93a2137a5f980e0da6443f23e..a028350ba8ecc1a498f12e1f37947809fd3a4247 100644 (file)
@@ -1,4 +1,4 @@
-6a1d165c2218cd127ee937a1f45599075762f716
+195060166e6045408a2cb95e6aa88c6f0b98f20b
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 4ac55af743333ae6c805fe9b97ab11d25a04aa94..2112de6abfcd54c4190ac144e6446b0c0c1a31f5 100644 (file)
@@ -18307,6 +18307,16 @@ Slice_value_expression::do_traverse(Traverse* traverse)
   return TRAVERSE_CONTINUE;
 }
 
+// Determine type of a slice value.
+
+void
+Slice_value_expression::do_determine_type(const Type_context*)
+{
+  this->valmem_->determine_type_no_context();
+  this->len_->determine_type_no_context();
+  this->cap_->determine_type_no_context();
+}
+
 Expression*
 Slice_value_expression::do_copy()
 {
index 3d7e78711bdd3c42c92cc7b3ee75ab99cd109328..bdb7ccd010d51cddf9157a505b408543ad436d40 100644 (file)
@@ -4364,8 +4364,7 @@ class Slice_value_expression : public Expression
   { return this->type_; }
 
   void
-  do_determine_type(const Type_context*)
-  { }
+  do_determine_type(const Type_context*);
 
   Expression*
   do_copy();
@@ -4419,7 +4418,7 @@ class Slice_info_expression : public Expression
 
   void
   do_determine_type(const Type_context*)
-  { }
+  { this->slice_->determine_type_no_context(); }
 
   Expression*
   do_copy()