aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-02-10 22:35:32 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-02-10 22:35:32 +0000
commit6df1f72e94e2d66a56952b541d66739e5f43165b (patch)
tree45ee38d86ef1ea7fdb3ebe2e7b4432a856ff98c2
parenta14dd08adf1e1a3deaf6baf1ffdf55f8143f00f9 (diff)
downloadgcc-6df1f72e94e2d66a56952b541d66739e5f43165b.zip
gcc-6df1f72e94e2d66a56952b541d66739e5f43165b.tar.gz
gcc-6df1f72e94e2d66a56952b541d66739e5f43165b.tar.bz2
Determine types in global variable preinit blocks.
From-SVN: r170025
-rw-r--r--gcc/go/gofrontend/gogo.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/gogo.cc b/gcc/go/gofrontend/gogo.cc
index aa66cf4..e3c56b6 100644
--- a/gcc/go/gofrontend/gogo.cc
+++ b/gcc/go/gofrontend/gogo.cc
@@ -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