runtime: skip zero-sized fields in structs when converting to FFI
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 13 Jul 2018 20:39:02 +0000 (20:39 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 13 Jul 2018 20:39:02 +0000 (20:39 +0000)
commit867b003fd74a1f77c9835a8c64e1dcf88f639aff
tree56301120971100639a4f923361812cb8d0b79362
parent7264261f64fab95545cd1e5bae429fad5f2b44d7
runtime: skip zero-sized fields in structs when converting to FFI

    The libffi library doesn't understand zero-sized objects.
    When we see a zero-sized field in a struct, just skip it when
    converting to the FFI data structures. There is no value to pass in
    any case, so not telling libffi about the field doesn't affect
    anything.

    The test case for this is https://golang.org/cl/123316.

    Fixes golang/go#26335

    Reviewed-on: https://go-review.googlesource.com/123335

From-SVN: r262651
gcc/go/gofrontend/MERGE
libgo/go/runtime/ffi.go