1. 27 Feb, 2019 4 commits
    • Matthew Dempsky's avatar
      cmd/compile: unify duplicate const detection logic · 6fa7669f
      Matthew Dempsky authored
      Consistent logic for handling both duplicate map keys and case values,
      and eliminates ad hoc value hashing code.
      
      Also makes cmd/compile consistent with go/types's handling of
      duplicate constants (see #28085), which is at least an improvement
      over the status quo even if we settle on something different for the
      spec.
      
      As a side effect, this also suppresses cmd/compile's warnings about
      duplicate nils in (non-interface expression) switch statements, which
      was technically never allowed by the spec anyway.
      
      Updates #28085.
      Updates #28378.
      
      Change-Id: I176a251e770c3c5bc11c2bf8d1d862db8f252a17
      Reviewed-on: https://go-review.googlesource.com/c/152544
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      6fa7669f
    • Matthew Dempsky's avatar
      cmd/compile/internal/ssa: fix bad CL rebase · e5fb1c6d
      Matthew Dempsky authored
      CL 142497 renamed "statictmp_N" to ".stmp_N", but missed an instance
      that was added by CL 151498 (submitted between the window that CL
      142497 was reviewed/tested and later rebased/merged).
      
      Change-Id: I597ee59dfa40821c7af2881b47e06f84a8140ec8
      Reviewed-on: https://go-review.googlesource.com/c/163877
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e5fb1c6d
    • Brian Kessler's avatar
      math/big: handle alias of cofactor inputs in GCD · a73abca3
      Brian Kessler authored
      If the variables passed in to the cofactor arguments of GCD (x, y)
      aliased the input arguments (a, b), the previous implementation would
      result in incorrect results for y.  This change reorganizes the calculation
      so that the only case that need to be handled is when y aliases b, which
      can be handled with a simple check.
      
      Tests were added for all of the alias cases for input arguments and and
      and irrelevant test case for a previous binary GCD calculation was dropped.
      
      Fixes #30217
      
      Change-Id: Ibe6137f09b3e1ae3c29e3c97aba85b67f33dc169
      Reviewed-on: https://go-review.googlesource.com/c/162517
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      a73abca3
    • go101's avatar
      go/ast: break out after first variable in ExampleCommentMap · 572329ef
      go101 authored
      The current ExampleCommentMap might panic if there are more satisfied
      comments in the parsed program.
      
      Change-Id: Ibe6943470aa0cfb450dae9fc07c1199acaabef73
      GitHub-Last-Rev: c79e98c2868179ea47618b296ce28c5eebc0b99d
      GitHub-Pull-Request: golang/go#28587
      Reviewed-on: https://go-review.googlesource.com/c/147359
      Run-TryBot: Robert Griesemer <gri@golang.org>
      Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      572329ef
  2. 26 Feb, 2019 36 commits