]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: adjust interface conversion function selection with 0-sized fields
authorCherry Zhang <cherryyz@google.com>
Thu, 8 Apr 2021 19:24:08 +0000 (15:24 -0400)
committerCherry Zhang <cherryyz@google.com>
Thu, 8 Apr 2021 21:26:36 +0000 (21:26 +0000)
commitec367e5b05becab0cfb371fdf10ba55319301e9d
treee28d189fadfc5e12c62fa79d89d0ea3d5b5983e7
parent6c98ecda100c2e3f8325d0b958f53aeaeb92c101
cmd/compile: adjust interface conversion function selection with 0-sized fields

0-sized fields do not affect how arguments are passed under the
register ABI. But it does affect the size and alignment of the
type, and may affect the choice of interface conversion function.
Specifically, struct { a [0]int32; b [4]byte } should be passed in
memory, therefore should not use convT32.

Change-Id: Idfa21af79b81c196b50253b0be1fa4edecd12b45
Reviewed-on: https://go-review.googlesource.com/c/go/+/308651
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/walk/convert.go