1. 17 Jan, 2018 2 commits
    • Keith Randall's avatar
      cmd/fix: extend typechecker to use cgo types · 2dc025e4
      Keith Randall authored
      If a file uses cgo, incorporate the types generated by running cgo.
      
      Update #23091
      
      Change-Id: I10958fa7fd6027c2c96a9fd8a9658de35439719f
      Reviewed-on: https://go-review.googlesource.com/87616Reviewed-by: default avatarRobert Griesemer <gri@golang.org>
      2dc025e4
    • Keith Randall's avatar
      cmd/cgo: rewrite CFTypeRef and subytes on Darwin to uintptr · d162a297
      Keith Randall authored
      Cgo currently maps CFTypeRef and its subtypes to unsafe.Pointer
      or a pointer to a named empty struct.
      
      However, Darwin sometimes encodes some of CFTypeRef's subtypes as a
      few int fields packed in a pointer wrapper. This hackery confuses the
      Go runtime as the pointers can look like they point to things that
      shouldn't be pointed at.
      
      Switch CFTypeRef and its subtypes to map to uintptr.
      
      Detecting the affected set of types is tricky, there are over 200 of
      them, and the set isn't static across Darwin versions. Fortunately,
      downcasting from CFTypeRef to a subtype requires calling CFGetTypeID,
      getting a CFTypeID token, and comparing that with a known id from a
      *GetTypeID() call. So we can find all the type names by detecting all
      the *GetTypeID() prototypes and rewriting the corresponding *Ref types
      to uintptr. This strategy covers all the cases I've checked and is
      unlikely to have a false positive.
      
      Update #23091.
      
      Change-Id: I487eb4105c9b4785ba564de9c38d472c8c9a76ac
      Reviewed-on: https://go-review.googlesource.com/87615
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      d162a297
  2. 16 Jan, 2018 4 commits
  3. 15 Jan, 2018 3 commits
  4. 14 Jan, 2018 1 commit
  5. 12 Jan, 2018 2 commits
  6. 11 Jan, 2018 9 commits
  7. 10 Jan, 2018 15 commits
  8. 09 Jan, 2018 4 commits