Commit df459d5e authored by Keith Randall's avatar Keith Randall

cmd/compile: emit symbol for constant string before parallel compiler phase

This CL makes sure we walk the newly generated assignment. Part of
that walk makes sure that all symbols for strings are emitted before
we start referencing them during the parallel compilation
phase. Without this change, those references during the parallel phase
do a create-if-not-exist, which leads to a data race.

I'm not 100% sure this is the fix for the issues below, but optimistically
assuming it is...

Fixes #28170
Fixes #28159

Change-Id: Ic63d5160ad9be5cb23fa6bbb2183e4848776c0ff
Reviewed-on: https://go-review.googlesource.com/c/141648
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: 's avatarJosh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 43308663
......@@ -1460,7 +1460,9 @@ opswitch:
as := nod(OAS,
nod(OIND, p, nil),
nod(OIND, convnop(nod(OSPTR, s, nil), t.PtrTo()), nil))
init.Append(typecheck(as, Etop))
as = typecheck(as, Etop)
as = walkstmt(as)
init.Append(as)
}
// Slice the [n]byte to a []byte.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment