diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-05-23 23:55:59 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-05-23 23:55:59 +0000 |
commit | 8be04b48a4b31ede3691a70daba6dbc03dc428c2 (patch) | |
tree | a251a08e36e2b219fef77b7a3d6c0e2b96c57364 /gcc | |
parent | 4b3e2314759ccd32e04f35090df50af1a2c4697a (diff) | |
download | gcc-8be04b48a4b31ede3691a70daba6dbc03dc428c2.zip gcc-8be04b48a4b31ede3691a70daba6dbc03dc428c2.tar.gz gcc-8be04b48a4b31ede3691a70daba6dbc03dc428c2.tar.bz2 |
compiler: detect failure to set init priority for package
This would have caught the problem fixed by https://golang.org/cl/43610.
Reviewed-on: https://go-review.googlesource.com/43999
From-SVN: r248394
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/gogo.cc | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 2a4aa2d..17239fd 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -369e1efe19adfc5393d2235992327f39360e0554 +ec49c69df1df4d62f3751fcd7e930d6508d67bf2 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 daf2ba4..26f6441 100644 --- a/gcc/go/gofrontend/gogo.cc +++ b/gcc/go/gofrontend/gogo.cc @@ -689,7 +689,13 @@ Gogo::init_imports(std::vector<Bstatement*>& init_stmts, Bfunction *bfunction) this->imported_init_fns_.begin(); p != this->imported_init_fns_.end(); ++p) - v.push_back(*p); + { + if ((*p)->priority() < 0) + go_error_at(Linemap::unknown_location(), + "internal error: failed to set init priority for %s", + (*p)->package_name().c_str()); + v.push_back(*p); + } std::sort(v.begin(), v.end(), priority_compare); // We build calls to the init functions, which take no arguments. |