A variable with a preinit block requires an intialization function.

From-SVN: r168198
This commit is contained in:
Ian Lance Taylor 2010-12-23 01:35:27 +00:00
parent 9d65de2123
commit 1e9402cb3d

View file

@ -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;