Skip to content

Commit

Permalink
compiler: Don't crash on invalid array type declarations.
Browse files Browse the repository at this point in the history
    
    Fixes golang/go#12937.
    
    Reviewed-on: https://go-review.googlesource.com/16233

From-SVN: r232857
  • Loading branch information
Ian Lance Taylor committed Jan 26, 2016
1 parent e4aac1d commit 7c97a53
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gcc/go/gofrontend/MERGE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
731941c155214d6158fa800e52ab3225c0b55f73
721c778adb8f99d8a6b7795dbad86013ccc9ba91

The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
9 changes: 9 additions & 0 deletions gcc/go/gofrontend/gogo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2699,6 +2699,15 @@ Gogo::lower_parse_tree()
{
Lower_parse_tree lower_parse_tree(this, NULL);
this->traverse(&lower_parse_tree);

// There might be type definitions that involve expressions such as the
// array length. Make sure to lower these expressions as well. Otherwise,
// errors hidden within a type can introduce unexpected errors into later
// passes.
for (std::vector<Type*>::iterator p = this->verify_types_.begin();
p != this->verify_types_.end();
++p)
Type::traverse(*p, &lower_parse_tree);
}

// Lower a block.
Expand Down

0 comments on commit 7c97a53

Please sign in to comment.