]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.12] cmd/cgo: fix inappropriate array copy
authorIan Lance Taylor <iant@golang.org>
Mon, 24 Jun 2019 20:17:30 +0000 (13:17 -0700)
committerIan Lance Taylor <iant@golang.org>
Wed, 26 Jun 2019 18:24:59 +0000 (18:24 +0000)
commit77c14d2973aa9365bf07ebe9b2c17585f8cece0c
tree198993a9c01a0ed4075b6e580e2e8418a6e5fffd
parent4ce6a8e89668b87dce67e2f55802903d6eb9110a
[release-branch.go1.12] cmd/cgo: fix inappropriate array copy

Ensure that during rewriting of expressions that take the address of
an array, that we properly recognize *ast.IndexExpr as an operation
to create a pointer variable and thus assign the proper addressOf
and deference operators as "&" and "*" respectively.

This fixes a regression from CL 142884.

This is a backport of CLs 183458 and 183778 to the 1.12 release branch.
It is not a cherry pick because the code in misc/cgo/test has changed.

Updates #32579
Fixes #32756

Change-Id: I0daa75ec62cccbe82ab658cb2947f51423e0c235
Reviewed-on: https://go-review.googlesource.com/c/go/+/183627
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
misc/cgo/test/cgo_test.go
misc/cgo/test/issue32579.go [new file with mode: 0644]
src/cmd/cgo/gcc.go