apiserver/client: work around compiler bug with named return values #4887

Merged
merged 1 commit into from Mar 24, 2016

Conversation

Projects
None yet
2 participants
Contributor

davecheney commented Mar 24, 2016

Upstream golang/go#14904

Returning a complex variable by value with a mix of named and implicit
returns was throwing off the compiler. This caused the memory occupied
by the return value to be considered dead before the end of the
function, leading to the gc freeing that memory prematurely.

The bug is not believed to not affect any shipping Go 1.6 compiler, but
it seems prudent to work around the compiler issue in our code.

(Review request: http://reviews.vapour.ws/r/4336/)

apiserver/status: work around compiler bug with named return values
Upstream golang/go#14904

Returning a complex variable by value with a mix of named and implicit
returns was throwing off the compiler. This caused the memory occupied
by the return value to be considered dead before the end of the
function, leading to the gc freeing that memory prematurely.

The bug is not believed to not affect any shipping Go 1.6 compiler, but
it seems prudent to work around the compiler issue in our code.

@davecheney davecheney changed the title from apiserver/status: work around compiler bug with named return values to apiserver/client: work around compiler bug with named return values Mar 24, 2016

Contributor

davecheney commented Mar 24, 2016

$$JFDI$$

(it's important)

Contributor

jujubot commented Mar 24, 2016

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit 69d8569 into juju:master Mar 24, 2016

@davecheney davecheney deleted the davecheney:fixedbug/14904 branch Mar 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment