]> Cypherpunks repositories - gostls13.git/commit
reflect: test that Call results are not addressable
authorIan Lance Taylor <iant@golang.org>
Tue, 12 Apr 2016 22:47:17 +0000 (15:47 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 12 Apr 2016 23:14:16 +0000 (23:14 +0000)
commit982274c96d6c9ad88a9deb07583d3b74ec2df357
treef023e8c69e1ef33fbd8db918386f4d2dfeb72676
parentf0c5b8b9c9c7900033ddb11b584da6198d599454
reflect: test that Call results are not addressable

Gccgo was erroneously marking Call results as addressable, which led to
an obscure bug using text/template, as text/template calls CanAddr to
check whether to take the address of a value when looking up methods.
When a function returned a pointer, and CanAddr was true, the result was
a pointer to a pointer that had no methods.

Fixed in gccgo by https://golang.org/cl/21908.  Adding the test here so
that it doesn't regress.

Change-Id: I1d25b868e1b8e2348b21cbac6404a636376d1a4a
Reviewed-on: https://go-review.googlesource.com/21930
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/reflect/all_test.go