Determine types in global variable preinit blocks.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 10 Feb 2011 22:35:32 +0000 (22:35 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 10 Feb 2011 22:35:32 +0000 (22:35 +0000)
From-SVN: r170025

gcc/go/gofrontend/gogo.cc

index aa66cf4d10986f53c93fbb40ba24c59705f19ad2..e3c56b6318d0b6476d01654c43d2a952b910e697 100644 (file)
@@ -3357,6 +3357,9 @@ Variable::type() const
 void
 Variable::determine_type()
 {
+  if (this->preinit_ != NULL)
+    this->preinit_->determine_types();
+
   // A variable in a type switch with a nil case will have the wrong
   // type here.  It will have an initializer which is a type guard.
   // We want to initialize it to the value without the type guard, and