Commit 269b2f2d authored by Russ Cox's avatar Russ Cox

cmd/gc: fix race detector on tail-call wrappers

(By not using the tail-call wrappers when the race
detector is enabled.)

R=golang-dev, minux.ma, dvyukov, daniel.morsing
CC=golang-dev
https://golang.org/cl/10227043
parent f882bc87
......@@ -268,7 +268,6 @@ struct Node
uchar dupok; // duplicate definitions ok (for func)
schar likely; // likeliness of if statement
uchar hasbreak; // has break statement
uchar norace; // disable race detector for this function
uint esc; // EscXXX
int funcdepth;
......
......@@ -58,7 +58,7 @@ racewalk(Node *fn)
Node *nodpc;
char s[1024];
if(fn->norace || ispkgin(omit_pkgs, nelem(omit_pkgs)))
if(ispkgin(omit_pkgs, nelem(omit_pkgs)))
return;
if(!ispkgin(noinst_pkgs, nelem(noinst_pkgs))) {
......
......@@ -2573,11 +2573,9 @@ genwrapper(Type *rcvr, Type *method, Sym *newnam, int iface)
dot = adddot(nod(OXDOT, this->left, newname(method->sym)));
// generate call
if(isptr[rcvr->etype] && isptr[methodrcvr->etype] && method->embedded && !isifacemethod(method->type)) {
if(!flag_race && isptr[rcvr->etype] && isptr[methodrcvr->etype] && method->embedded && !isifacemethod(method->type)) {
// generate tail call: adjust pointer receiver and jump to embedded method.
fn->norace = 1; // something about this body makes the race detector unhappy.
// skip final .M
dot = dot->left;
dot = dot->left; // skip final .M
if(!isptr[dotlist[0].field->type->etype])
dot = nod(OADDR, dot, N);
as = nod(OAS, this->left, nod(OCONVNOP, dot, N));
......
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