• Keith Randall's avatar
    cmd/compile: zero ambiguously live variables at VARKILLs · 38dee12d
    Keith Randall authored
    At VARKILLs, zero a variable if it is ambiguously live.
    After the VARKILL anything this variable references
    might be collected. If it were to become live again later,
    the GC will see references to already-collected objects.
    
    We don't know a variable is ambiguously live until very
    late in compilation (after lowering, register allocation, ...),
    so it is hard to generate the code in an arch-independent way.
    We also have to be careful not to clobber any registers.
    Fortunately, this almost never happens so performance is ~irrelevant.
    
    There are only 2 instances where this triggers in the stdlib.
    
    Fixes #20029
    
    Change-Id: Ia9585a91d7b823fad4a9d141d954464cc7af31f4
    Reviewed-on: https://go-review.googlesource.com/41076
    Run-TryBot: Keith Randall <khr@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarDavid Chase <drchase@google.com>
    38dee12d
galign.go 614 Bytes