Commit 8be04b48 by Ian Lance Taylor

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
parent 4b3e2314
369e1efe19adfc5393d2235992327f39360e0554 ec49c69df1df4d62f3751fcd7e930d6508d67bf2
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.
...@@ -689,7 +689,13 @@ Gogo::init_imports(std::vector<Bstatement*>& init_stmts, Bfunction *bfunction) ...@@ -689,7 +689,13 @@ Gogo::init_imports(std::vector<Bstatement*>& init_stmts, Bfunction *bfunction)
this->imported_init_fns_.begin(); this->imported_init_fns_.begin();
p != this->imported_init_fns_.end(); p != this->imported_init_fns_.end();
++p) ++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); std::sort(v.begin(), v.end(), priority_compare);
// We build calls to the init functions, which take no arguments. // We build calls to the init functions, which take no arguments.
......
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