aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-12-03 07:21:16 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-12-03 07:21:16 +0000
commit9cc263b8526c272221d81af96869b6f7c7f28072 (patch)
treeb76814771600a46287a85c3c9159bf15b0b27ab8
parent9204da15efba1a64f25b087376910c62c5f67d64 (diff)
downloadgcc-9cc263b8526c272221d81af96869b6f7c7f28072.zip
gcc-9cc263b8526c272221d81af96869b6f7c7f28072.tar.gz
gcc-9cc263b8526c272221d81af96869b6f7c7f28072.tar.bz2
compiler: Fix field tracking for references in global initializers.
From-SVN: r194073
-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 5fee256..a2a76d9 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;