• Josh Bleecher Snyder's avatar
    cmd/compile: don't mutate shared nodes in orderinit · 8e36575e
    Josh Bleecher Snyder authored
    A few gc.Node ops may be shared across functions.
    The compiler is (mostly) already careful to avoid mutating them.
    However, from a concurrency perspective, replacing (say)
    an empty list with an empty list still counts as a mutation.
    One place this occurs is orderinit. Avoid it.
    
    This requires fixing one spot where shared nodes were mutated.
    It doesn't result in any functional or performance changes.
    
    Passes toolstash-check.
    
    Updates #15756
    
    Change-Id: I63c93b31baeeac62d7574804acb6b7f2bc9d14a9
    Reviewed-on: https://go-review.googlesource.com/39196
    Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    8e36575e
order.go 36.3 KB