This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Go patch committed: Traverse function types
- 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: Tue, 21 Dec 2010 10:10:19 -0800
- Subject: Go patch committed: Traverse function types
In the function traversal routine, I forgot to traverse the function
type itself. Doing this avoids a crash when an array has an unknown
length. Bootstrapped and tested on x86_64-unknown-linux-gnu. Committed
to mainline.
Ian
diff -r 997516c45e8b go/gogo.cc
--- a/go/gogo.cc Mon Dec 20 22:11:12 2010 -0800
+++ b/go/gogo.cc Tue Dec 21 10:05:18 2010 -0800
@@ -2644,6 +2644,14 @@
{
unsigned int traverse_mask = traverse->traverse_mask();
+ if ((traverse_mask
+ & (Traverse::traverse_types | Traverse::traverse_expressions))
+ != 0)
+ {
+ if (Type::traverse(this->type_, traverse) == TRAVERSE_EXIT)
+ return TRAVERSE_EXIT;
+ }
+
// FIXME: We should check traverse_functions here if nested
// functions are stored in block bindings.
if (this->block_ != NULL