summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;