* Go patch committed: report invalid receiver types
@ 2015-09-03 5:26 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2015-09-03 5:26 UTC (permalink / raw)
To: gcc-patches, gofrontend-dev
[-- Attachment #1: Type: text/plain, Size: 265 bytes --]
This patch by Chris Manghane fixes the Go frontend to report invalid
function receiver types as an error rather than crashing. This fixes
https://golang.org/issue/12324 . Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu. Committed to mainline.
Ian
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1026 bytes --]
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE (revision 227420)
+++ gcc/go/gofrontend/MERGE (working copy)
@@ -1,4 +1,4 @@
-3f8feb4f905535448833a14e4f5c83f682087749
+672ac2abc52d8bd70cb9fb03dd4a32fdde9c438f
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 227299)
+++ gcc/go/gofrontend/gogo.cc (working copy)
@@ -1818,7 +1818,11 @@ Gogo::start_function(const std::string&
function);
}
else
- go_unreachable();
+ {
+ error_at(type->receiver()->location(),
+ "invalid receiver type (receiver must be a named type)");
+ ret = Named_object::make_function(name, NULL, function);
+ }
}
this->package_->bindings()->add_method(ret);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-09-03 4:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-03 5:26 Go patch committed: report invalid receiver types 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).