]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix code duplication in race-instrumentation
authorDhananjay Nakrani <dhananjaynakrani@gmail.com>
Mon, 17 Oct 2016 21:17:46 +0000 (14:17 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 18 Oct 2016 20:11:01 +0000 (20:11 +0000)
commit8b3194ac8fd8436bf4bfd252de58ab81154f334d
tree510422b61fc4de3013e0f4a1a653711f150966f5
parent2b687a7df854f3c88b266b6cec59a207a45c2353
cmd/compile: fix code duplication in race-instrumentation

instrumentnode() accidentally copies parent's already-instrumented nodes
into child's Ninit block. This generates repeated code in race-instrumentation.
This case surfaces only when it duplicates inline-labels, because of
compile time error. In other cases, it silently generates incorrect
instrumented code. This change prevents it from doing so.

Fixes #17449.

Change-Id: Icddf2198990442166307e176b7e20aa0cf6c171c
Reviewed-on: https://go-review.googlesource.com/31317
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/racewalk.go
test/fixedbugs/issue17449.go [new file with mode: 0644]