* Go patch committed: don't crash on invalid numeric type
@ 2015-08-26 19:47 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2015-08-26 19:47 UTC (permalink / raw)
To: gcc-patches, gofrontend-dev
[-- 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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-08-26 19:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-26 19:47 Go patch committed: don't crash on invalid numeric type Ian Lance Taylor
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).