Skip to content

Commit 475e7d0

Browse files
cmd/gc: fix handling of append with -race.
Also re-enable race tests in run.bash. Fixes #7334. LGTM=rsc R=rsc, dvyukov, iant, bradfitz, dave CC=golang-codereviews https://golang.org/cl/65740043
1 parent 96678f9 commit 475e7d0

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

src/cmd/gc/walk.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2707,9 +2707,10 @@ appendslice(Node *n, NodeList **init)
27072707
fn = syslook("copy", 1);
27082708
argtype(fn, l1->type);
27092709
argtype(fn, l2->type);
2710-
l = list(l, mkcall1(fn, types[TINT], init,
2710+
nt = mkcall1(fn, types[TINT], &l,
27112711
nptr1, nptr2,
2712-
nodintconst(s->type->type->width)));
2712+
nodintconst(s->type->type->width));
2713+
l = list(l, nt);
27132714
} else {
27142715
// memmove(&s[len(l1)], &l2[0], len(l2)*sizeof(T))
27152716
nptr1 = nod(OINDEX, s, nod(OLEN, l1, N));
@@ -2724,7 +2725,8 @@ appendslice(Node *n, NodeList **init)
27242725

27252726
nwid = cheapexpr(conv(nod(OLEN, l2, N), types[TUINTPTR]), &l);
27262727
nwid = nod(OMUL, nwid, nodintconst(s->type->type->width));
2727-
l = list(l, mkcall1(fn, T, init, nptr1, nptr2, nwid));
2728+
nt = mkcall1(fn, T, &l, nptr1, nptr2, nwid);
2729+
l = list(l, nt);
27282730
}
27292731

27302732
// s = s[:len(l1)+len(l2)]

src/run.bash

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ go test sync -short -timeout=$(expr 120 \* $timeout_scale)s -cpu=10
5757

5858
# Race detector only supported on Linux and OS X,
5959
# and only on amd64, and only when cgo is enabled.
60-
# Disabled due to golang.org/issue/7334; remove XXX below
61-
# and in run.bat to reenable.
6260
case "$GOHOSTOS-$GOOS-$GOARCH-$CGO_ENABLED" in
63-
XXXlinux-linux-amd64-1 | XXXdarwin-darwin-amd64-1)
61+
linux-linux-amd64-1 | darwin-darwin-amd64-1)
6462
echo
6563
echo '# Testing race detector.'
6664
go test -race -i runtime/race flag
@@ -175,7 +173,7 @@ rm -f goplay
175173

176174
[ "$GOARCH" == arm ] ||
177175
(xcd ../test/bench/shootout
178-
./timing.sh -test || exit 1
176+
time ./timing.sh -test || exit 1
179177
) || exit $?
180178

181179
[ "$GOOS" == openbsd ] || # golang.org/issue/5057

src/run.bat

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ echo.
5454

5555
:: Race detector only supported on Linux and OS X,
5656
:: and only on amd64, and only when cgo is enabled.
57-
:: Disabled due to golang.org/issue/7334; remove XXX below
58-
:: and in run.bash to reenable.
59-
if not "%GOHOSTOS%-%GOOS%-%GOARCH%-%CGO_ENABLED%" == "XXXwindows-windows-amd64-1" goto norace
57+
if not "%GOHOSTOS%-%GOOS%-%GOARCH%-%CGO_ENABLED%" == "windows-windows-amd64-1" goto norace
6058
echo # Testing race detector.
6159
go test -race -i runtime/race flag
6260
if errorlevel 1 goto fail

0 commit comments

Comments
 (0)