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: don't crash on invalid numeric type
Date: Wed, 26 Aug 2015 19:47:00 -0000 [thread overview]
Message-ID: <CAOyqgcV+mbtfsPMMLhCQGTNfA2K7OuxmcNoLY411pQu-T_GmBg@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 279 bytes --]
This patch by Chris Manghane fixes a compiler crash on an invalid
program when the compiler tries to set a numeric constant to an
invalid type. This fixes https://golang.org/issue/11537.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.
Ian
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 980 bytes --]
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE (revision 227201)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-d5e6af4e6dd456075a1ec1c03d0dc41cbea5eb36
+cd5362c7bb0b207f484a8dfb8db229fd2bffef09
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
Index: gcc/go/gofrontend/expressions.cc
===================================================================
--- gcc/go/gofrontend/expressions.cc (revision 227201)
+++ gcc/go/gofrontend/expressions.cc (working copy)
@@ -15150,7 +15150,11 @@ Numeric_constant::set_type(Type* type, b
else if (type->complex_type() != NULL)
ret = this->check_complex_type(type->complex_type(), issue_error, loc);
else
- go_unreachable();
+ {
+ ret = false;
+ if (issue_error)
+ go_assert(saw_errors());
+ }
if (ret)
this->type_ = type;
return ret;
reply other threads:[~2015-08-26 19:18 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=CAOyqgcV+mbtfsPMMLhCQGTNfA2K7OuxmcNoLY411pQu-T_GmBg@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).