public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@golang.org>
To: gcc-patches <gcc-patches@gcc.gnu.org>,
		"gofrontend-dev@googlegroups.com"
	<gofrontend-dev@googlegroups.com>
Subject: Go patch committed: detect failure to set init priority
Date: Wed, 24 May 2017 00:52:00 -0000	[thread overview]
Message-ID: <CAOyqgcUsHSTCx=Z5U4F5BBs3AJat9Ykkamq7ExUFc_6-s84Y8A@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 316 bytes --]

This patch to the Go frontend detects a failure to set the init
priority for a package.  This would have caught the bug fixed in the
patch in https://golang.org/cl/43610 aka
https://gcc.gnu.org/ml/gcc-patches/2017-05/msg01416.html .
Bootstrapped and ran Go tests on x86_64-pc-linux-gnu.  Committed to
mainline.

Ian

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1114 bytes --]

Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE	(revision 248248)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -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.
Index: gcc/go/gofrontend/gogo.cc
===================================================================
--- gcc/go/gofrontend/gogo.cc	(revision 248081)
+++ gcc/go/gofrontend/gogo.cc	(working copy)
@@ -689,7 +689,13 @@ Gogo::init_imports(std::vector<Bstatemen
 	 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.

                 reply	other threads:[~2017-05-23 23:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAOyqgcUsHSTCx=Z5U4F5BBs3AJat9Ykkamq7ExUFc_6-s84Y8A@mail.gmail.com' \
    --to=iant@golang.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gofrontend-dev@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).