summaryrefslogtreecommitdiff
path: root/libgo/misc/cgo/errors/badsym_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/misc/cgo/errors/badsym_test.go')
-rw-r--r--libgo/misc/cgo/errors/badsym_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgo/misc/cgo/errors/badsym_test.go b/libgo/misc/cgo/errors/badsym_test.go
index fc687567bf7..bc3ba2b489f 100644
--- a/libgo/misc/cgo/errors/badsym_test.go
+++ b/libgo/misc/cgo/errors/badsym_test.go
@@ -201,6 +201,10 @@ func cCompilerCmd(t *testing.T) []string {
if !lastSpace {
cc = append(cc, s[start:])
}
+
+ // Force reallocation (and avoid aliasing bugs) for tests that append to cc.
+ cc = cc[:len(cc):len(cc)]
+
return cc
}