mirror of
https://github.com/golang/go
synced 2024-11-19 02:14:43 -07:00
cmd/gc: fix racewalk after writebarrierfat was renamed to typedmemmove
Renaming the function broke the race detector since it looked for the name, didn't find it anymore and didn't insert the necessary instrumentation. Change-Id: I11fed6e807cc35be5724d26af12ceff33ebf4f7b Reviewed-on: https://go-review.googlesource.com/2661 Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
This commit is contained in:
parent
e8e89347cd
commit
301ad790a2
@ -210,11 +210,12 @@ racewalknode(Node **np, NodeList **init, int wr, int skip)
|
||||
case OCALLFUNC:
|
||||
// Instrument dst argument of runtime.writebarrier* calls
|
||||
// as we do not instrument runtime code.
|
||||
if(n->left->sym != S && n->left->sym->pkg == runtimepkg && strncmp(n->left->sym->name, "writebarrier", 12) == 0) {
|
||||
if(n->left->sym != S && n->left->sym->pkg == runtimepkg &&
|
||||
(strncmp(n->left->sym->name, "writebarrier", 12) == 0 || strcmp(n->left->sym->name, "typedmemmove") == 0)) {
|
||||
// Find the dst argument.
|
||||
// The list can be reordered, so it's not necessary just the first or the second element.
|
||||
for(l = n->list; l; l = l->next) {
|
||||
if(strcmp(n->left->sym->name, "writebarrierfat") == 0) {
|
||||
if(strcmp(n->left->sym->name, "typedmemmove") == 0) {
|
||||
if(l->n->left->xoffset == widthptr)
|
||||
break;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user