From 51b08adabf40a7922771ff4e0c36c8680c082825 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 14 Jun 2013 17:59:48 +0000 Subject: compiler: fix computation of Offsetof. The implied offsets must be taken into account when the selector involves anonymous fields. From-SVN: r200098 --- gcc/go/gofrontend/expressions.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'gcc/go/gofrontend/expressions.h') diff --git a/gcc/go/gofrontend/expressions.h b/gcc/go/gofrontend/expressions.h index af178de..36f4c0d 100644 --- a/gcc/go/gofrontend/expressions.h +++ b/gcc/go/gofrontend/expressions.h @@ -1860,6 +1860,15 @@ class Field_reference_expression : public Expression field_index() const { return this->field_index_; } + // Return whether this node was implied by an anonymous field. + bool + implicit() const + { return this->implicit_; } + + void + set_implicit(bool implicit) + { this->implicit_ = implicit; } + // Set the struct expression. This is used when parsing. void set_struct_expression(Expression* expr) @@ -1914,6 +1923,9 @@ class Field_reference_expression : public Expression Expression* expr_; // The zero-based index of the field we are retrieving. unsigned int field_index_; + // Whether this node was emitted implicitly for an embedded field, + // that is, expr_ is not the expr_ of the original user node. + bool implicit_; // Whether we have already emitted a fieldtrack call. bool called_fieldtrack_; }; -- cgit v1.1