Skip to content

Commit df459d5

Browse files
committed
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 <[email protected]> Reviewed-by: Josh Bleecher Snyder <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 4330866 commit df459d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cmd/compile/internal/gc/walk.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,9 @@ opswitch:
14601460
as := nod(OAS,
14611461
nod(OIND, p, nil),
14621462
nod(OIND, convnop(nod(OSPTR, s, nil), t.PtrTo()), nil))
1463-
init.Append(typecheck(as, Etop))
1463+
as = typecheck(as, Etop)
1464+
as = walkstmt(as)
1465+
init.Append(as)
14641466
}
14651467

14661468
// Slice the [n]byte to a []byte.

0 commit comments

Comments
 (0)