This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Go patch committed: Traverse erroneous send/receive statements
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Thu, 24 Feb 2011 07:18:38 -0800
- Subject: Go patch committed: Traverse erroneous send/receive statements
This patch to the Go frontend ensures that even erroneous send/receive
statements are traversed. This will force the compiler to traverse
them, which means that any names that they define will have their types
determined. This avoids knock-on errors if statements that are added to
the tree refer to those names. Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r 89d21108be7d go/parse.cc
--- a/go/parse.cc Thu Feb 24 05:58:05 2011 -0800
+++ b/go/parse.cc Thu Feb 24 07:15:04 2011 -0800
@@ -4203,6 +4203,12 @@
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) ) ) ":" .