projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d65de2
)
A variable with a preinit block requires an intialization function.
author
Ian Lance Taylor
<ian@gcc.gnu.org>
Thu, 23 Dec 2010 01:35:27 +0000
(
01:35
+0000)
committer
Ian Lance Taylor
<ian@gcc.gnu.org>
Thu, 23 Dec 2010 01:35:27 +0000
(
01:35
+0000)
From-SVN: r168198
gcc/go/gofrontend/gogo.cc
patch
|
blob
|
history
diff --git
a/gcc/go/gofrontend/gogo.cc
b/gcc/go/gofrontend/gogo.cc
index aa62ce6d868b0c88c504b7cab1f707d14d657b5c..9e51b63e62f0a71083fcbddb9fcb5b6837444ab3 100644
(file)
--- a/
gcc/go/gofrontend/gogo.cc
+++ b/
gcc/go/gofrontend/gogo.cc
@@
-1384,7
+1384,11
@@
Gogo::determine_types()
// If this is a global variable which requires runtime
// initialization, we need an initialization function.
- if (!variable->is_global() || variable->init() == NULL)
+ if (!variable->is_global())
+ ;
+ else if (variable->has_pre_init())
+ this->need_init_fn_ = true;
+ else if (variable->init() == NULL)
;
else if (variable->type()->interface_type() != NULL)
this->need_init_fn_ = true;