Commit 5abf395b authored by Ian Lance Taylor's avatar Ian Lance Taylor

Avoid race condition. Following the left to right rule,

s.output.Data() was being retrieved before the synchronization
point, which meant that it could be retrieved before the
goroutine wrote it.  Using gccgo this caused random errors.

R=gri
DELTA=2  (1 added, 0 deleted, 1 changed)
OCL=31046
CL=31267
parent 27432d67
...@@ -745,7 +745,8 @@ func (f Format) Eval(env Environment, args ...) ([]byte, os.Error) { ...@@ -745,7 +745,8 @@ func (f Format) Eval(env Environment, args ...) ([]byte, os.Error) {
errors <- nil; // no errors errors <- nil; // no errors
}(); }();
return s.output.Data(), <- errors; err := <- errors;
return s.output.Data(), err;
} }
......
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