public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Go patch committed: Mark erroneous builtin calls as erroneous
@ 2015-03-31  0:11 Ian Lance Taylor
  0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2015-03-31  0:11 UTC (permalink / raw)
  To: gcc-patches, gofrontend-dev

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

This patch to the Go frontend marks some builtin calls with erroneous
as erroneous.  This avoids a compiler crash on invalid code
(http://golang.org/issue/10285).  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

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

diff -r 6780bf5a7069 go/expressions.cc
--- a/go/expressions.cc	Mon Mar 30 10:30:44 2015 -0700
+++ b/go/expressions.cc	Mon Mar 30 17:07:15 2015 -0700
@@ -7887,7 +7887,10 @@
 	Type* arg1_type = args->front()->type();
 	Type* arg2_type = args->back()->type();
 	if (arg1_type->is_error() || arg2_type->is_error())
-	  break;
+	  {
+	    this->set_is_error();
+	    break;
+	  }
 
 	Type* e1;
 	if (arg1_type->is_slice_type())
@@ -7929,7 +7932,10 @@
 	  }
 	if (args->front()->type()->is_error()
 	    || args->back()->type()->is_error())
-	  break;
+	  {
+	    this->set_is_error();
+	    break;
+	  }
 
 	Array_type* at = args->front()->type()->array_type();
 	Type* e = at->element_type();

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

only message in thread, other threads:[~2015-03-31  0:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-31  0:11 Go patch committed: Mark erroneous builtin calls as erroneous 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).