compiler: determine types of Slice_{value,info} expressions

This fixes an accidental omission in the determine types pass.

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

Change-Id: I750a09bb9790b922583eaad3abb620536f9b3a66
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/504797
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Ian Lance Taylor 2023-06-21 14:27:02 -07:00
Родитель 6a1d165c22
Коммит 195060166e
2 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -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()
{

Просмотреть файл

@ -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()