]> Cypherpunks.ru repositories - gostls13.git/commitdiff
cmd/gc: fix handling of append with -race.
authorRémy Oudompheng <oudomphe@phare.normalesup.org>
Wed, 19 Feb 2014 07:19:27 +0000 (08:19 +0100)
committerRémy Oudompheng <oudomphe@phare.normalesup.org>
Wed, 19 Feb 2014 07:19:27 +0000 (08:19 +0100)
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

src/cmd/gc/walk.c
src/run.bash
src/run.bat

index fe07490cbdb4b33e91fa87807edcc9c22c7f9ef4..97473de0715b68ffe1adeb0dabaaf7476739cea3 100644 (file)
@@ -2707,9 +2707,10 @@ appendslice(Node *n, NodeList **init)
                        fn = syslook("copy", 1);
                argtype(fn, l1->type);
                argtype(fn, l2->type);
-               l = list(l, mkcall1(fn, types[TINT], init,
+               nt = mkcall1(fn, types[TINT], &l,
                                nptr1, nptr2,
-                               nodintconst(s->type->type->width)));
+                               nodintconst(s->type->type->width));
+               l = list(l, nt);
        } else {
                // memmove(&s[len(l1)], &l2[0], len(l2)*sizeof(T))
                nptr1 = nod(OINDEX, s, nod(OLEN, l1, N));
@@ -2724,7 +2725,8 @@ appendslice(Node *n, NodeList **init)
 
                nwid = cheapexpr(conv(nod(OLEN, l2, N), types[TUINTPTR]), &l);
                nwid = nod(OMUL, nwid, nodintconst(s->type->type->width));
-               l = list(l, mkcall1(fn, T, init, nptr1, nptr2, nwid));
+               nt = mkcall1(fn, T, &l, nptr1, nptr2, nwid);
+               l = list(l, nt);
        }
 
        // s = s[:len(l1)+len(l2)]
index 42522477913a8c0ced83ce37e1ba3bafe7d8e4d9..9a01e0631b643a3f71207e44234865d2bf9e62a6 100755 (executable)
@@ -57,10 +57,8 @@ go test sync -short -timeout=$(expr 120 \* $timeout_scale)s -cpu=10
 
 # Race detector only supported on Linux and OS X,
 # and only on amd64, and only when cgo is enabled.
-# Disabled due to golang.org/issue/7334; remove XXX below
-# and in run.bat to reenable.
 case "$GOHOSTOS-$GOOS-$GOARCH-$CGO_ENABLED" in
-XXXlinux-linux-amd64-1 | XXXdarwin-darwin-amd64-1)
+linux-linux-amd64-1 | darwin-darwin-amd64-1)
        echo
        echo '# Testing race detector.'
        go test -race -i runtime/race flag
@@ -175,7 +173,7 @@ rm -f goplay
 
 [ "$GOARCH" == arm ] ||
 (xcd ../test/bench/shootout
-./timing.sh -test || exit 1
+time ./timing.sh -test || exit 1
 ) || exit $?
 
 [ "$GOOS" == openbsd ] || # golang.org/issue/5057
index 00bbd5905a57cb49d08001a7410288d376a22e67..f01032699ed13b3a77a5042dff442f53d6cb54fd 100644 (file)
@@ -54,9 +54,7 @@ echo.
 
 :: Race detector only supported on Linux and OS X,
 :: and only on amd64, and only when cgo is enabled.
-:: Disabled due to golang.org/issue/7334; remove XXX below
-:: and in run.bash to reenable.
-if not "%GOHOSTOS%-%GOOS%-%GOARCH%-%CGO_ENABLED%" == "XXXwindows-windows-amd64-1" goto norace
+if not "%GOHOSTOS%-%GOOS%-%GOARCH%-%CGO_ENABLED%" == "windows-windows-amd64-1" goto norace
 echo # Testing race detector.
 go test -race -i runtime/race flag
 if errorlevel 1 goto fail