]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile: add write barrier to type switch
authorKeith Randall <khr@golang.org>
Fri, 12 Feb 2016 18:07:36 +0000 (10:07 -0800)
committerKeith Randall <khr@golang.org>
Fri, 12 Feb 2016 21:07:21 +0000 (21:07 +0000)
commite3033fc535eb29ab7533ecc4a86c607c2046b9c7
treef71a28932e72cfadcbbb3886530240b98a65cfe2
parentc93193aec0f33e901d6802e61c966286785f57ee
cmd/compile: add write barrier to type switch

Type switches need write barriers if the written-to
variable is heap allocated.

For the added needwritebarrier call, the right arg doesn't
really matter, I just pass something that will never disqualify
the write barrier.  The left arg is the one that matters.

Fixes #14306

Change-Id: Ic2754167cce062064ea2eeac2944ea4f77cc9c3b
Reviewed-on: https://go-review.googlesource.com/19481
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/gen.go
test/writebarrier.go