diff mbox

Go patch RFA: Fix taking the address of a field of a local variable

Message ID mcripf3o87l.fsf@dhcp-172-18-216-180.mtv.corp.google.com
State New
Headers show

Commit Message

Ian Lance Taylor June 7, 2012, 8:08 a.m. UTC
This patch to the Go compiler fixes the case of taking the address of a
field of a local variable.  Previously taking the address of the field
was not treated as taking the address of the variable.  But, of course,
it is.  This patch fixes the problem.  Bootstrapped and ran Go testsuite
on x86_64-unknown-linux-gnu.  Committed to mainline.

OK for 4.7 branch?  This is a real bug, bad runtime code generated for
valid Go code.

Ian

Comments

Richard Biener June 11, 2012, 8:56 a.m. UTC | #1
On Thu, Jun 7, 2012 at 10:08 AM, Ian Lance Taylor <iant@google.com> wrote:
> This patch to the Go compiler fixes the case of taking the address of a
> field of a local variable.  Previously taking the address of the field
> was not treated as taking the address of the variable.  But, of course,
> it is.  This patch fixes the problem.  Bootstrapped and ran Go testsuite
> on x86_64-unknown-linux-gnu.  Committed to mainline.
>
> OK for 4.7 branch?  This is a real bug, bad runtime code generated for
> valid Go code.

Ok for 4.7.2, thus after 4.7.1 has been released.

Thanks,
Richard.

> Ian
>
diff mbox

Patch

diff -r 784c72ffe147 go/expressions.h
--- a/go/expressions.h	Wed Jun 06 23:30:08 2012 -0700
+++ b/go/expressions.h	Thu Jun 07 01:03:20 2012 -0700
@@ -1888,6 +1888,10 @@ 
   do_is_addressable() const
   { return this->expr_->is_addressable(); }
 
+  void
+  do_address_taken(bool escapes)
+  { this->expr_->address_taken(escapes); }
+
   tree
   do_get_tree(Translate_context*);