OSDN Git Service

Fix missing type traversals.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Feb 2011 04:54:27 +0000 (04:54 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Feb 2011 04:54:27 +0000 (04:54 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@170427 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/statements.cc

index 6440ee1..264dd57 100644 (file)
@@ -2357,6 +2357,9 @@ class Const_expression : public Expression
   check_for_init_loop();
 
  protected:
+  int
+  do_traverse(Traverse*);
+
   Expression*
   do_lower(Gogo*, Named_object*, int);
 
@@ -2412,6 +2415,16 @@ class Const_expression : public Expression
   mutable bool seen_;
 };
 
+// Traversal.
+
+int
+Const_expression::do_traverse(Traverse* traverse)
+{
+  if (this->type_ != NULL)
+    return Type::traverse(this->type_, traverse);
+  return TRAVERSE_CONTINUE;
+}
+
 // Lower a constant expression.  This is where we convert the
 // predeclared constant iota into an integer value.
 
index 99ed665..45e45a3 100644 (file)
@@ -318,6 +318,9 @@ Temporary_statement::get_decl() const
 int
 Temporary_statement::do_traverse(Traverse* traverse)
 {
+  if (this->type_ != NULL
+      && this->traverse_type(traverse, this->type_) == TRAVERSE_EXIT)
+    return TRAVERSE_EXIT;
   if (this->init_ == NULL)
     return TRAVERSE_CONTINUE;
   else