compiler: remove some erroneous code that was never run
The code accidentally called Type::type_descriptor rather than the
do_type_descriptor method. Calling Type::type_descriptor with a second
argument of NULL would always crash. Since that never happened,
it revealed that this code was never actually executed.
Fixes https://gcc.gnu.org/PR95970
Change-Id: I76a5c2780f36425aadcb153250d4943a63c831f5
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/240477
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/go/types.cc b/go/types.cc
index d6cd326..3459a33 100644
--- a/go/types.cc
+++ b/go/types.cc
@@ -11106,15 +11106,11 @@
{
if (this->is_error_)
return Expression::make_error(this->location_);
- if (name == NULL && this->is_alias_)
- {
- if (this->seen_alias_)
- return Expression::make_error(this->location_);
- this->seen_alias_ = true;
- Expression* ret = this->type_->type_descriptor(gogo, NULL);
- this->seen_alias_ = false;
- return ret;
- }
+
+ // We shouldn't see unnamed type aliases here. They should have
+ // been removed by the call to unalias in Type::type_descriptor_pointer.
+ // We can see named type aliases via Type::named_type_descriptor.
+ go_assert(name != NULL || !this->is_alias_);
// If NAME is not NULL, then we don't really want the type
// descriptor for this type; we want the descriptor for the