]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: SSA, don't let write barrier clobber return values
authorKeith Randall <khr@golang.org>
Fri, 27 May 2016 21:07:37 +0000 (14:07 -0700)
committerKeith Randall <khr@golang.org>
Fri, 27 May 2016 22:11:45 +0000 (22:11 +0000)
commit42da35c699853002b7695052a8eeb3f10019cfd5
tree94d416a7fe6014c5c5ed25448e7593883b4be3ac
parent3a6a41868eb620912235f2dd3f9738c76035e731
cmd/compile: SSA, don't let write barrier clobber return values

When we do *p = f(), we might need to copy the return value from
f to p with a write barrier.  The write barrier itself is a call,
so we need to copy the return value of f to a temporary location
before we call the write barrier function.  Otherwise, the call
itself (specifically, marshalling the args to typedmemmove) will
clobber the value we're trying to write.

Fixes #15854

Change-Id: I5703da87634d91a9884e3ec098d7b3af713462e7
Reviewed-on: https://go-review.googlesource.com/23522
Reviewed-by: David Chase <drchase@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/fixedbugs_test.go [new file with mode: 0644]
src/cmd/compile/internal/gc/ssa.go