Modifying the input slice broke the new test for whether gccgo
supports -fgo-importcfg, as the test passed a slice of the argument
slice it was in the process of building.
Fixes #22089
Change-Id: I45444a82673223c46be0c8579da3e31a74c32d73
Reviewed-on: https://go-review.googlesource.com/67191
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
}
b.flagCache = make(map[[2]string]bool)
}
- cmdArgs := append(compiler, flag, "-c", "trivial.c")
+ cmdArgs := append([]string(nil), compiler...)
+ cmdArgs = append(cmdArgs, flag, "-c", "trivial.c")
if cfg.BuildN || cfg.BuildX {
b.Showcmd(b.WorkDir, "%s", joinUnambiguously(cmdArgs))
if cfg.BuildN {