1. 28 Sep, 2017 4 commits
  2. 27 Sep, 2017 23 commits
  3. 26 Sep, 2017 10 commits
  4. 25 Sep, 2017 3 commits
    • Joe Tsai's avatar
      archive/tar: avoid empty IO operations · 7246585f
      Joe Tsai authored
      The interfaces for io.Reader and io.Writer permit calling Read/Write
      with an empty buffer. However, this condition is often not well tested
      and can lead to bugs in various implementations of io.Reader and io.Writer.
      For example, see #22028 for buggy io.Reader in the bzip2 package.
      
      We reduce the likelihood of hitting these bugs by adjusting
      regFileReader.Read and regFileWriter.Write to avoid performing
      Read and Write calls when the buffer is known to be empty.
      
      Fixes #22029
      
      Change-Id: Ie4a26be53cf87bc4d2abd951fa005db5871cc75c
      Reviewed-on: https://go-review.googlesource.com/66111
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      Reviewed-by: 's avatarGiovanni Bajo <rasky@develer.com>
      Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      7246585f
    • Joe Tsai's avatar
      compress/bzip2: fix checksum mismatch on empty reads · 57f7bc3a
      Joe Tsai authored
      Previously, the read method checked whether the current block
      was fully consumed or not based on whether the buffer could be filled
      with a non-zero number of bytes. This check is problematic because
      zero bytes could be read if the provided buffer is empty.
      
      We fix this case by simply checking for whether the input buffer
      provided by the user was empty or not. If empty, we assume that
      we could not read any bytes because the buffer was too small,
      rather than indicating that the current block was fully exhausted.
      
      This check causes bzip2.Reader to be unable to make progress
      on the next block unless a non-empty buffer is provided.
      However, that is an entirely reasonable expectation since a
      non-empty buffer needs to be provided eventually anyways to
      read the actual contents of subsequent blocks.
      
      Fixes #22028
      
      Change-Id: I2bb1b2d54e78567baf2bf7b490a272c0853d7bfe
      Reviewed-on: https://go-review.googlesource.com/66110Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
      57f7bc3a
    • Daniel Martí's avatar
      cmd/compile: add runtime GC funcs to inlining test · 4d3d3334
      Daniel Martí authored
      This is based on a list that Austin Clements provided in mid-2016. It is
      mostly untouched, except for the fact that the wbufptr funcs were
      removed from the runtime thus removed from the lits here too.
      
      Add a section for these GC funcs, since there are quite a lot of them
      and the runtime has tons of funcs that we want to inline. As before,
      sort this section too.
      
      Also place some of these funcs out of the GC section, as they are not
      directly related to the GC.
      
      Updates #21851.
      
      Change-Id: I35eb777a4c50b5f655618920dc2bc568c7c30ff5
      Reviewed-on: https://go-review.googlesource.com/65654
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarAustin Clements <austin@google.com>
      4d3d3334