Commit 25486c28 by Ian Lance Taylor

compiler: Don't crash on erroneous array types.

    
    Fixes golang/go#11546.
    
    Reviewed-on: https://go-review.googlesource.com/13795

From-SVN: r227184
parent f14e0109
81810917af7ba19e1f9f8efc8b1989f7d6419d30 d6d59d5927c4ea0c02468ebc6a2df431fb64595a
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -5781,6 +5781,8 @@ Array_type::verify_length() ...@@ -5781,6 +5781,8 @@ Array_type::verify_length()
bool bool
Array_type::do_verify() Array_type::do_verify()
{ {
if (this->element_type()->is_error_type())
return false;
if (!this->verify_length()) if (!this->verify_length())
this->length_ = Expression::make_error(this->length_->location()); this->length_ = Expression::make_error(this->length_->location());
return true; return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment