]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libgo: Update from Go 1.5 to Go 1.5.1.
authorIan Lance Taylor <ian@gcc.gnu.org>
Sat, 31 Oct 2015 15:23:52 +0000 (15:23 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Sat, 31 Oct 2015 15:23:52 +0000 (15:23 +0000)
    Reviewed-on: https://go-review.googlesource.com/16527

From-SVN: r229624

16 files changed:
gcc/go/gofrontend/MERGE
libgo/MERGE
libgo/VERSION
libgo/go/cmd/go/alldocs.go
libgo/go/cmd/go/build.go
libgo/go/cmd/go/pkg.go
libgo/go/fmt/scan.go
libgo/go/fmt/scan_test.go
libgo/go/internal/syscall/windows/registry/value.go
libgo/go/net/cgo_solaris.go
libgo/go/net/http/httputil/reverseproxy.go
libgo/go/net/http/httputil/reverseproxy_test.go
libgo/go/net/lookup.go
libgo/go/net/port_test.go
libgo/go/runtime/extern.go
libgo/go/runtime/gc_test.go

index c2307e1167ed0ee6baeca98b0f6d8ee5ece81b5a..8eae1f4c9e7a422bbdf3c488533986d821d90ec5 100644 (file)
@@ -1,4 +1,4 @@
-4b6b496579225cdd897130f6d6fd18ecb100bf99
+17cc10f7fb07e3f37448feaeb416b52618ae8bbb
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index af7e452a4d1982f73b4968b5915263faf4b168a6..ea32fc1cfb08ef7a4a16b9d3b90b750eb823ab2d 100644 (file)
@@ -1,4 +1,4 @@
-bb03defe933c89fee44be675d7aa0fbd893ced30
+f2e4c8b5fb3660d793b2c545ef207153db0a34b1
 
 The first line of this file holds the git revision number of the
 last merge done from the master library sources.
index 661b4f922848d4a0171b0b1ab2e8b0fe2e91fbc5..77af434f110af853a21db3f2317bc0586ecb4bb8 100644 (file)
@@ -1 +1 @@
-go1.5
\ No newline at end of file
+go1.5.1
\ No newline at end of file
index 6077d93a436f4a440bdb9b955095625900ef90b9..1134997eaaa277f0b0f6592a23c615438b97b327 100644 (file)
@@ -81,7 +81,6 @@ and test commands:
 
        -a
                force rebuilding of packages that are already up-to-date.
-               In Go releases, does not apply to the standard library.
        -n
                print the commands but do not run them.
        -p n
index 56b15ad90d31b40a5a1e82fc451f5474a957ed9c..3afac2ee062b9a2c9c2a08b72326fff087d63643 100644 (file)
@@ -60,7 +60,6 @@ and test commands:
 
        -a
                force rebuilding of packages that are already up-to-date.
-               In Go releases, does not apply to the standard library.
        -n
                print the commands but do not run them.
        -p n
index 1af59b3760a9bb2c312ba99d6d136b9a3ea2e631..ff5236e90abd0b0cd08817c55419baded43cb095 100644 (file)
@@ -372,7 +372,8 @@ func loadImport(path, srcDir string, parent *Package, stk *importStack, importPo
        if gobin != "" {
                bp.BinDir = gobin
        }
-       if err == nil && !isLocal && bp.ImportComment != "" && bp.ImportComment != path && (!go15VendorExperiment || !strings.Contains(path, "/vendor/")) {
+       if err == nil && !isLocal && bp.ImportComment != "" && bp.ImportComment != path &&
+               (!go15VendorExperiment || (!strings.Contains(path, "/vendor/") && !strings.HasPrefix(path, "vendor/"))) {
                err = fmt.Errorf("code in directory %s expects import %q", bp.Dir, bp.ImportComment)
        }
        p.load(stk, bp, err)
index 5b9b516353b94c18ff3bf7538f61aac7b7acf897..e3e0fd0b5858d79d84a8888159aa567da7c594ee 100644 (file)
@@ -83,6 +83,8 @@ func Scanln(a ...interface{}) (n int, err error) {
 // the format.  It returns the number of items successfully scanned.
 // If that is less than the number of arguments, err will report why.
 // Newlines in the input must match newlines in the format.
+// The one exception: the verb %c always scans the next rune in the
+// input, even if it is a space (or tab etc.) or newline.
 func Scanf(format string, a ...interface{}) (n int, err error) {
        return Fscanf(os.Stdin, format, a...)
 }
@@ -1164,15 +1166,18 @@ func (s *ss) doScanf(format string, a []interface{}) (numProcessed int, err erro
                if !widPresent {
                        s.maxWid = hugeWid
                }
-               s.SkipSpace()
+
+               c, w := utf8.DecodeRuneInString(format[i:])
+               i += w
+
+               if c != 'c' {
+                       s.SkipSpace()
+               }
                s.argLimit = s.limit
                if f := s.count + s.maxWid; f < s.argLimit {
                        s.argLimit = f
                }
 
-               c, w := utf8.DecodeRuneInString(format[i:])
-               i += w
-
                if numProcessed >= len(a) { // out of operands
                        s.errorString("too few operands for format %" + format[i-w:])
                        break
index a3784364e630329d9b9214dd8af80dd426e92321..334c4a6b2428b944f9c71b9904067862f0a72b89 100644 (file)
@@ -300,10 +300,13 @@ var scanfTests = []ScanfTest{
        {"%2s", "sssss", &xVal, Xs("ss")},
 
        // Fixed bugs
-       {"%d\n", "27\n", &intVal, 27},  // ok
-       {"%d\n", "28 \n", &intVal, 28}, // was: "unexpected newline"
-       {"%v", "0", &intVal, 0},        // was: "EOF"; 0 was taken as base prefix and not counted.
-       {"%v", "0", &uintVal, uint(0)}, // was: "EOF"; 0 was taken as base prefix and not counted.
+       {"%d\n", "27\n", &intVal, 27},      // ok
+       {"%d\n", "28 \n", &intVal, 28},     // was: "unexpected newline"
+       {"%v", "0", &intVal, 0},            // was: "EOF"; 0 was taken as base prefix and not counted.
+       {"%v", "0", &uintVal, uint(0)},     // was: "EOF"; 0 was taken as base prefix and not counted.
+       {"%c", " ", &uintVal, uint(' ')},   // %c must accept a blank.
+       {"%c", "\t", &uintVal, uint('\t')}, // %c must accept any space.
+       {"%c", "\n", &uintVal, uint('\n')}, // %c must accept any space.
 }
 
 var overflowTests = []ScanTest{
index bb45a23643416e517ff99a4060671cac70cf1083..f4bb1b35a542d3979d7028cf70fbba3dbc253e9c 100644 (file)
@@ -310,7 +310,6 @@ loopItems:
                                break
                        }
                        if err == syscall.ERROR_MORE_DATA {
-                               println(len(buf), l)
                                // Double buffer size and try again.
                                l = uint32(2 * len(buf))
                                buf = make([]uint16, l)
index c5a7a3549dda989a5f84b3477360b0385a97523e..05811c6c2523cfb54b005c330f15276f1dc9e9a4 100644 (file)
@@ -7,7 +7,7 @@
 package net
 
 /*
-#cgo LDFLAGS: -lsocket -lnsl
+#cgo LDFLAGS: -lsocket -lnsl -lsendfile
 #include <netdb.h>
 */
 
index 3b7a184d9339f691513e1449f647144fd0d1d01f..c8e113221c45dfa1fca62effc4189c7a3983450c 100644 (file)
@@ -105,7 +105,7 @@ type requestCanceler interface {
 }
 
 type runOnFirstRead struct {
-       io.Reader
+       io.Reader // optional; nil means empty body
 
        fn func() // Run before first Read, then set to nil
 }
@@ -115,6 +115,9 @@ func (c *runOnFirstRead) Read(bs []byte) (int, error) {
                c.fn()
                c.fn = nil
        }
+       if c.Reader == nil {
+               return 0, io.EOF
+       }
        return c.Reader.Read(bs)
 }
 
index 25947e6a8ab203ceb0c912969cc9c066cd0bbe05..80a26abe414f1b1252234839ba0f67259a3ac3dc 100644 (file)
@@ -7,6 +7,7 @@
 package httputil
 
 import (
+       "bufio"
        "io/ioutil"
        "log"
        "net/http"
@@ -281,3 +282,41 @@ func TestReverseProxyCancellation(t *testing.T) {
                t.Fatal("DefaultClient.Do() returned nil error")
        }
 }
+
+func req(t *testing.T, v string) *http.Request {
+       req, err := http.ReadRequest(bufio.NewReader(strings.NewReader(v)))
+       if err != nil {
+               t.Fatal(err)
+       }
+       return req
+}
+
+// Issue 12344
+func TestNilBody(t *testing.T) {
+       backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+               w.Write([]byte("hi"))
+       }))
+       defer backend.Close()
+
+       frontend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
+               backURL, _ := url.Parse(backend.URL)
+               rp := NewSingleHostReverseProxy(backURL)
+               r := req(t, "GET / HTTP/1.0\r\n\r\n")
+               r.Body = nil // this accidentally worked in Go 1.4 and below, so keep it working
+               rp.ServeHTTP(w, r)
+       }))
+       defer frontend.Close()
+
+       res, err := http.Get(frontend.URL)
+       if err != nil {
+               t.Fatal(err)
+       }
+       defer res.Body.Close()
+       slurp, err := ioutil.ReadAll(res.Body)
+       if err != nil {
+               t.Fatal(err)
+       }
+       if string(slurp) != "hi" {
+               t.Errorf("Got %q; want %q", slurp, "hi")
+       }
+}
index a7ceee823f17592e23a0cbeac406f92e2e24fb7b..9008322dc5a76fd9a401e6e08fb181b8a9d4a99a 100644 (file)
@@ -123,6 +123,9 @@ func lookupIPDeadline(host string, deadline time.Time) (addrs []IPAddr, err erro
 
 // LookupPort looks up the port for the given network and service.
 func LookupPort(network, service string) (port int, err error) {
+       if n, i, ok := dtoi(service, 0); ok && i == len(service) {
+               return n, nil
+       }
        return lookupPort(network, service)
 }
 
index 2dacd975e7ac86af7e19eb0d0a4b4e1a96e721e6..258a5bda48f263fbf8b27c3747e0826420a6b261 100644 (file)
@@ -27,6 +27,7 @@ var portTests = []struct {
        {"tcp", "time", 37, true},
        {"tcp", "domain", 53, true},
        {"tcp", "finger", 79, true},
+       {"tcp", "42", 42, true},
 
        {"udp", "echo", 7, true},
        {"udp", "tftp", 69, true},
@@ -36,6 +37,7 @@ var portTests = []struct {
        {"udp", "ntp", 123, true},
        {"udp", "snmp", 161, true},
        {"udp", "syslog", 514, true},
+       {"udp", "42", 42, true},
 
        {"--badnet--", "zzz", 0, false},
        {"tcp", "--badport--", 0, false},
index 1f6b13eece657780e1f98b4d953281e32643e54b..6301d0173b26c03b32c81a1e91f1cd53ace8c9e9 100644 (file)
@@ -47,6 +47,9 @@ It is a comma-separated list of name=val pairs setting these named variables:
        that allow the garbage collector to avoid repeating a stack scan during the
        mark termination phase.
 
+       gcstackbarrierall: setting gcstackbarrierall=1 installs stack barriers
+       in every stack frame, rather than in exponentially-spaced frames.
+
        gcstoptheworld: setting gcstoptheworld=1 disables concurrent garbage collection,
        making every garbage collection a stop-the-world event. Setting gcstoptheworld=2
        also disables concurrent sweeping after the garbage collection finishes.
index 262f87d66b0e8d7110be42a034c18a0b96c37181..2a95cc70e84865da9d60200d6557b6bb4e206018 100644 (file)
@@ -471,4 +471,21 @@ func testAssertVar(x interface{}) error {
        return nil
 }
 
+func TestAssertE2T2Liveness(t *testing.T) {
+       *runtime.TestingAssertE2T2GC = true
+       defer func() {
+               *runtime.TestingAssertE2T2GC = false
+       }()
+
+       poisonStack()
+       testIfaceEqual(io.EOF)
+}
+
+func testIfaceEqual(x interface{}) {
+       if x == "abc" {
+               // Prevent inlining
+               panic("")
+       }
+}
+
 */