public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
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: Mark erroneous builtin calls as erroneous
Date: Tue, 31 Mar 2015 00:11:00 -0000	[thread overview]
Message-ID: <CAOyqgcVGkcepCkDSfQAgSGGEtQ72AK-ES5ziNE0tyBzrUpfSHQ@mail.gmail.com> (raw)

[-- 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();

                 reply	other threads:[~2015-03-31  0:11 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=CAOyqgcVGkcepCkDSfQAgSGGEtQ72AK-ES5ziNE0tyBzrUpfSHQ@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).