• Dmitriy Vyukov's avatar
    cmd/gc: racewalk: do not double function calls · abb313f8
    Dmitriy Vyukov authored
    Current racewalk transformation looks like:
    x := <-makeChan().c
    \/\/\/\/\/\/\/\/\/
    runtime.raceread(&makeChan().c)
    x := <-makeChan().c
    and so makeChan() is called twice.
    With this CL the transformation looks like:
    x := <-makeChan().c
    \/\/\/\/\/\/\/\/\/
    chan *tmp = &(makeChan().c)
    raceread(&*tmp)
    x := <-(*tmp)
    Fixes #4245.
    
    R=golang-dev, rsc
    CC=golang-dev
    https://golang.org/cl/6822075
    abb313f8
racewalk.c 10.9 KB