]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix race on initializing Sym symFunc flag
authorAustin Clements <austin@google.com>
Mon, 12 Nov 2018 21:49:52 +0000 (16:49 -0500)
committerAustin Clements <austin@google.com>
Mon, 12 Nov 2018 22:38:02 +0000 (22:38 +0000)
commit5cf2b4c2d39e0490b235822f5ea7fa105280b9f2
tree8019481e9e6f99cf819dd7ddcff9aa377fc34a5f
parentb52db19b983d9b92c013184f7699bba2d0166c10
cmd/compile: fix race on initializing Sym symFunc flag

SSA lowering can create PFUNC ONAME nodes when compiling method calls.
Since we generally initialize the node's Sym to a func when we set its
class to PFUNC, we did this here, too. Unfortunately, since SSA
compilation is concurrent, this can cause a race if two function
compilations try to initialize the same symbol.

Luckily, we don't need to do this at all, since we're actually just
wrapping an ONAME node around an existing Sym that's already marked as
a function symbol.

Fixes the linux-amd64-racecompile builder, which was broken by CL
147158.

Updates #27539.

Change-Id: I8ddfce6e66a08ce53998c5bfa6f5a423c1ffc1eb
Reviewed-on: https://go-review.googlesource.com/c/149158
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/ssa.go