aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2016-01-26 23:28:37 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2016-01-26 23:28:37 +0000
commit7c97a53ac2991e7804c72b4a168773212307db3b (patch)
tree57bc3b584cc5debb4b0d25f8d46f35b2e8d3a43b /gcc
parente4aac1d178008b0c40c0a44baa282d0d8be4e656 (diff)
downloadgcc-7c97a53ac2991e7804c72b4a168773212307db3b.zip
gcc-7c97a53ac2991e7804c72b4a168773212307db3b.tar.gz
gcc-7c97a53ac2991e7804c72b4a168773212307db3b.tar.bz2
compiler: Don't crash on invalid array type declarations.
Fixes golang/go#12937. Reviewed-on: https://go-review.googlesource.com/16233 From-SVN: r232857
Diffstat (limited to 'gcc')
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/gogo.cc9
2 files changed, 10 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 9540d16..96a1e9f 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -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.
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index 6708be9..5413cc9 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -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.