mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo: for C bitfields use only valid Go integer types
Fixes #22958 Change-Id: Ib078a5f6e1105a2afca77c6d9a05f65ddf5d9010 Reviewed-on: https://go-review.googlesource.com/81435 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
This commit is contained in:
parent
ea0d2c14f8
commit
bfa7a558bf
2 changed files with 27 additions and 1 deletions
|
|
@ -2388,7 +2388,9 @@ func (c *typeConv) Struct(dt *dwarf.StructType, pos token.Pos) (expr *ast.Struct
|
|||
size := t.Size
|
||||
talign := t.Align
|
||||
if f.BitSize > 0 {
|
||||
if f.BitSize%8 != 0 {
|
||||
switch f.BitSize {
|
||||
case 8, 16, 32, 64:
|
||||
default:
|
||||
continue
|
||||
}
|
||||
size = f.BitSize / 8
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue