summaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-12-03 07:21:16 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-12-03 07:21:16 +0000
commit66a6be58cc5f9d8f96ac913979fb06f7bbec2a5c (patch)
treeb76814771600a46287a85c3c9159bf15b0b27ab8 /gcc/go
parent5df02853d3d2fabd47a78570bc3ec7625f6c42e2 (diff)
downloadgcc-66a6be58cc5f9d8f96ac913979fb06f7bbec2a5c.tar.gz
compiler: Fix field tracking for references in global initializers.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194073 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/expressions.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 5fee25650b0..a2a76d9ce30 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -10651,7 +10651,8 @@ Field_reference_expression::do_lower(Gogo* gogo, Named_object* function,
// them if they are not referenced. The effect is that the only
// strings, indicating field references, that will wind up in the
// executable will be those for functions that are actually needed.
- function->func_value()->set_in_unique_section();
+ if (function != NULL)
+ function->func_value()->set_in_unique_section();
var->set_in_unique_section();
return this;