Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cgo: generates code with inappropriate array copy [1.12 backport] #32756

gopherbot opened this issue Jun 24, 2019 · 2 comments


Copy link

commented Jun 24, 2019

@ianlancetaylor requested issue #32579 to be considered for backport to the next 1.12 minor release.

@gopherbot please open backport to 1.12


This comment has been minimized.

Copy link

commented Jun 24, 2019

Change mentions this issue: [release-branch.go1.12] cmd/cgo: fix inappropriate array copy


This comment has been minimized.

Copy link

commented Jun 26, 2019

Closed by merging 77c14d2 to release-branch.go1.12.

@gopherbot gopherbot closed this Jun 26, 2019

gopherbot pushed a commit that referenced this issue Jun 26, 2019
[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
Run-TryBot: Ian Lance Taylor <>
TryBot-Result: Gobot Gobot <>
Reviewed-by: Emmanuel Odeke <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.