1. 25 Aug, 2017 2 commits
    • Joe Tsai's avatar
      archive/tar: return better WriteHeader errors · 3d62000a
      Joe Tsai authored
      WriteHeader may fail to encode a header for any number of reasons,
      which can be frustrating for the user when trying to create a tar archive.
      As we validate the Header, we generate an informative error message
      intended for human consumption and return that if and only if no
      format can be selected.
      
      This allows WriteHeader to return informative errors like:
          tar: cannot encode header: invalid PAX record: "linkpath = \x00hello"
          tar: cannot encode header: invalid PAX record: "SCHILY.xattr.foo=bar = baz"
          tar: cannot encode header: Format specifies GNU; and only PAX supports Xattrs
          tar: cannot encode header: Format specifies GNU; and GNU cannot encode ModTime=1969-12-31 15:59:59.0000005 -0800 PST
          tar: cannot encode header: Format specifies GNU; and GNU supports sparse files only with TypeGNUSparse
          tar: cannot encode header: Format specifies USTAR; and USTAR cannot encode ModTime=292277026596-12-04 07:30:07 -0800 PST
          tar: cannot encode header: Format specifies USTAR; and USTAR does not support sparse files
          tar: cannot encode header: Format specifies PAX; and only GNU supports TypeGNUSparse
      
      Updates #18710
      
      Change-Id: I82a498d6f29d02c4e73bce47b768eb578da8499c
      Reviewed-on: https://go-review.googlesource.com/58310
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      3d62000a
    • Keith Randall's avatar
      cmd/compile: remove more nil ptr checks after newobject · f1517ec6
      Keith Randall authored
      For code like the following (where x escapes):
      
         x := []int{1}
      
      We're currently generating a nil check.  The line above is really 3 operations:
      
      	t := new([1]int)
      	t[0] = 1
      	x := t[:]
      
      We remove the nil check for t[0] = 1, but not for t[:].
      
      Our current nil check removal rule is too strict about the possible
      memory arguments of the nil check. Unlike zeroing or storing to the
      result of runtime.newobject, the nilness of runtime.newobject is
      always false, even after other stores have happened in the meantime.
      
      Change-Id: I95fad4e3a59c27effdb37c43ea215e18f30b1e5f
      Reviewed-on: https://go-review.googlesource.com/58711
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
      f1517ec6
  2. 24 Aug, 2017 16 commits
  3. 23 Aug, 2017 12 commits
  4. 22 Aug, 2017 10 commits