This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go patch committed: Determine types in variable preinit blocks


The Go frontend uses a preinit block for global variables in a few
cases, such as when a global variable is initialized as part of a
tuple.  However, I forgot to run the type determination pass over those
preinit blocks.  This patch fixes that oversight.  Bootstrapped and ran
Go testsuite on x86_64-unknown-linux-gnu.  Committed to mainline.

Ian

diff -r 82f9ed04cbc2 go/gogo.cc
--- a/go/gogo.cc	Thu Feb 10 13:45:10 2011 -0800
+++ b/go/gogo.cc	Thu Feb 10 14:31:12 2011 -0800
@@ -3357,6 +3357,9 @@
 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]