Go patch committed: Ignore aliases in fieldtracking info

Message ID CAOyqgcU2wQy2PBRsvrBi1SQyUWx_2J5G1WnGv=CyjSaH=17gJA@mail.gmail.com
State New
Headers show
  • Go patch committed: Ignore aliases in fieldtracking info
Related show

Commit Message

Ian Lance Taylor Feb. 23, 2018, 9:39 p.m.
This patch to the Go frontend ignores aliases when emitting
fieldtracking info.  We want to track references to fields in the real
struct, not in some alias to the struct.  Bootstrapped and ran Go
testsuite on x86_64-pc-linux-gnu.  Committed to mainline.



Index: gcc/go/gofrontend/MERGE
--- gcc/go/gofrontend/MERGE	(revision 257914)
+++ gcc/go/gofrontend/MERGE	(working copy)
@@ -1,4 +1,4 @@ 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: gcc/go/gofrontend/expressions.cc
--- gcc/go/gofrontend/expressions.cc	(revision 257914)
+++ gcc/go/gofrontend/expressions.cc	(working copy)
@@ -11696,7 +11696,7 @@  Field_reference_expression::do_lower(Gog
   Location loc = this->location();
   std::string s = "fieldtrack \"";
-  Named_type* nt = this->expr_->type()->named_type();
+  Named_type* nt = this->expr_->type()->unalias()->named_type();
   if (nt == NULL || nt->named_object()->package() == NULL)