]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: fix racewalk{enter,exit} removal
authorKeith Randall <khr@google.com>
Fri, 28 Dec 2018 20:43:48 +0000 (12:43 -0800)
committerKeith Randall <khr@golang.org>
Sat, 29 Dec 2018 00:04:59 +0000 (00:04 +0000)
commit14bdcc76fd9aa3edda64ef07a526fbeeed8b4326
treeaa6a464aca7cd45c88a0204af82e72c8d0585a7e
parentd4599629674251e9134ea8e0aa4039d9de3dd678
cmd/compile: fix racewalk{enter,exit} removal

We can't remove race instrumentation unless there are no calls,
not just no static calls. Closure and interface calls also count.

The problem in issue 29329 is that there was a racefuncenter, an
InterCall, and a racefuncexit.  The racefuncenter was removed, then
the InterCall was rewritten to a StaticCall. That prevented the
racefuncexit from being removed. That caused an imbalance in
racefuncenter/racefuncexit calls, which made the race detector barf.

Bug introduced at CL 121235

Fixes #29329

Change-Id: I2c94ac6cf918dd910b74b2a0de5dc2480d236f16
Reviewed-on: https://go-review.googlesource.com/c/155917
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/compile/internal/ssa/rewrite.go
test/fixedbugs/issue29329.go [new file with mode: 0644]