public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Go patch committed: Don't crash on erroneous var init from receive
@ 2010-12-22 17:37 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2010-12-22 17:37 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

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

This patch to the Go frontend avoids a compiler crash when a variable is
initialized from a channel receive but the receive turns out to be
erroneous.  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: crash --]
[-- Type: text/x-diff, Size: 462 bytes --]

diff -r da6d9ff631bd go/gogo.cc
--- a/go/gogo.cc	Wed Dec 22 08:27:02 2010 -0800
+++ b/go/gogo.cc	Wed Dec 22 08:35:00 2010 -0800
@@ -3165,7 +3165,7 @@
     {
       Expression* channel = expr->receive_expression()->channel();
       Type* channel_type = channel->type();
-      if (channel_type->is_error_type())
+      if (channel_type->channel_type() == NULL)
 	return Type::make_error_type();
       return channel_type->channel_type()->element_type();
     }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-12-22 16:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-22 17:37 Go patch committed: Don't crash on erroneous var init from receive 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).