Traverse erroneous send/receive statements.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 24 Feb 2011 15:18:35 +0000 (15:18 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 24 Feb 2011 15:18:35 +0000 (15:18 +0000)
From-SVN: r170473

gcc/go/gofrontend/parse.cc

index abd75fb27a6d9db84642cb2752933302a7f86a68..ab6021d0b2c7d7ce42fe30360391c4f1c0ed0177 100644 (file)
@@ -4203,6 +4203,12 @@ Parse::comm_clause(Select_clauses* clauses, bool* saw_default)
 
   if (got_case)
     clauses->add(is_send, channel, val, var, is_default, statements, location);
+  else if (statements != NULL)
+    {
+      // Add the statements to make sure that any names they define
+      // are traversed.
+      this->gogo_->add_block(statements, location);
+    }
 }
 
 // CommCase = ( "default" | ( "case" ( SendExpr | RecvExpr) ) ) ":" .