Patchwork Go patch committed: Traverse function types

login
register
mail settings
Submitter Ian Taylor
Date Dec. 21, 2010, 6:10 p.m.
Message ID <mcrpqsvm1ys.fsf@google.com>
Download mbox | patch
Permalink /patch/76307/
State New
Headers show

Comments

Ian Taylor - Dec. 21, 2010, 6:10 p.m.
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

Patch

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