1. 25 Sep, 2017 3 commits
    • griesemer's avatar
      go/types: don't accept incorrect shift expression arguments · 45395b5a
      griesemer authored
      Under certain circumstances involving shifts, go/types didn't verify
      that untyped constant values were representable by the relevant type,
      leading to the acceptance of incorrect programs (see the issue).
      
      Fixing this code exposed another problem with int-to-string conversions
      which suddenly failed because now the type-checker complained that a
      (constant) integer argument wasn't representable as a string. Fixed that
      as well.
      
      Added many additional tests covering the various scenarious.
      
      Found two cmd/compile bugs in the process (#21979, #21981) and filed
      a go/types TODO (#21982).
      
      Fixes #21727.
      
      Change-Id: If443ee0230979cd7d45d2fc669e623648caa70da
      Reviewed-on: https://go-review.googlesource.com/65370Reviewed-by: default avatarAlan Donovan <adonovan@google.com>
      45395b5a
    • Daniel Martí's avatar
      cmd/compile: merge bytes inline test with the rest · 6945c67e
      Daniel Martí authored
      In golang.org/cl/42813, a test was added in the bytes package to check
      if a Buffer method was being inlined, using 'go tool nm'.
      
      Now that we have a compiler test that verifies that certain funcs are
      inlineable, merge it there. Knowing whether the funcs are inlineable is
      also more reliable than whether or not their symbol appears in the
      binary, too. For example, under some circumstances, inlineable funcs
      can't be inlined, such as if closures are used.
      
      While at it, add a few more bytes.Buffer methods that are currently
      inlined and should clearly stay that way.
      
      Updates #21851.
      
      Change-Id: I62066e32ef5542d37908bd64f90bda51276da4de
      Reviewed-on: https://go-review.googlesource.com/65658
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      Reviewed-by: default avatarMarvin Stenger <marvin.stenger94@gmail.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      6945c67e
    • Daniel Martí's avatar
      cmd/compile: refactor some more gotos away · 0168fdb5
      Daniel Martí authored
      The ones in racewalk.go are almost all useless, since they were just
      breaks.
      
      typecheck.go wasn't trivial, but still doable with an if/else chain.
      
      Also remove a single silly goto in const.go, while at it.
      
      Change-Id: I776a78df6bb3b6bd4f7e5feec546c772baf4e02e
      Reviewed-on: https://go-review.googlesource.com/65652
      Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      0168fdb5
  2. 24 Sep, 2017 8 commits
  3. 23 Sep, 2017 6 commits
  4. 22 Sep, 2017 19 commits
  5. 21 Sep, 2017 4 commits