Commit 301ad790 authored by Daniel Morsing's avatar Daniel Morsing

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/2661Reviewed-by: default avatarMinux Ma <minux@golang.org>
Reviewed-by: default avatarDmitry Vyukov <dvyukov@google.com>
parent e8e89347
......@@ -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 {
......
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