• Keith Randall's avatar
    cmd/compile: add write barrier to type switch · e3033fc5
    Keith Randall authored
    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/19481Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    e3033fc5
gen.go 25.6 KB