This patch from Rémy Oudompheng fixes a couple of compiler crashes.

The compiler would crash on:
        if true || x, y := 1, 2 {}
and
        var s string
        s = append(s, "hello")

Bootstrapped on x86_64-unknown-linux-gnu.  Committed to mainline and 4.7
branch.

Ian

diff -r f18209760e98 go/expressions.cc
--- a/go/expressions.cc	Wed Mar 28 14:25:57 2012 -0700
+++ b/go/expressions.cc	Wed Mar 28 14:32:00 2012 -0700
@@ -7441,6 +7441,8 @@
 void
 Builtin_call_expression::do_check_types(Gogo*)
 {
+  if (this->is_error_expression())
+    return;
   switch (this->code_)
     {
     case BUILTIN_INVALID:
diff -r f18209760e98 go/parse.cc
--- a/go/parse.cc	Wed Mar 28 14:25:57 2012 -0700
+++ b/go/parse.cc	Wed Mar 28 14:32:00 2012 -0700
@@ -3971,7 +3971,7 @@
 
   bool saw_simple_stat = false;
   Expression* cond = NULL;
-  bool saw_send_stmt;
+  bool saw_send_stmt = false;
   if (this->simple_stat_may_start_here())
     {
       cond = this->simple_stat(false, &saw_send_stmt, NULL, NULL);

Reply via email to