]> Cypherpunks repositories - gostls13.git/commitdiff
misc/cgo/testcshared: don't overwrite cc in parallel runs
authorIan Lance Taylor <iant@golang.org>
Mon, 9 Oct 2017 05:00:34 +0000 (22:00 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 9 Oct 2017 05:31:01 +0000 (05:31 +0000)
Fixes #22176

Change-Id: If47ec9a25da6b480868d8eeccc518dc97d48bda7
Reviewed-on: https://go-review.googlesource.com/69230
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
misc/cgo/testcshared/cshared_test.go

index b81ec3b4c12d57afca484bc13ee6cb93f44eebae..3c87850b399cf33607b1e50e02c09ee7ec10aa5e 100644 (file)
@@ -210,7 +210,9 @@ func runExe(t *testing.T, env []string, args ...string) string {
 
 func runCC(t *testing.T, args ...string) string {
        t.Helper()
-       return run(t, nil, append(cc, args...)...)
+       // This function is run in parallel, so append to a copy of cc
+       // rather than cc itself.
+       return run(t, nil, append(append([]string(nil), cc...), args...)...)
 }
 
 func createHeaders() error {