mirror of
https://github.com/golang/go
synced 2024-11-22 04:04:40 -07:00
Use BitSize instead of the field's type native ByteSize when calculating
structs containing bitfields. Fixes #163. R=rsc CC=golang-dev https://golang.org/cl/180059
This commit is contained in:
parent
a812332151
commit
7a5f4be97e
@ -693,6 +693,9 @@ func (c *typeConv) Struct(dt *dwarf.StructType) (expr *ast.StructType, csyntax s
|
||||
}
|
||||
|
||||
for _, f := range dt.Field {
|
||||
if f.BitSize > 0 && f.BitSize != f.ByteSize*8 {
|
||||
continue
|
||||
}
|
||||
if f.ByteOffset > off {
|
||||
fld = c.pad(fld, f.ByteOffset-off)
|
||||
off = f.ByteOffset
|
||||
|
Loading…
Reference in New Issue
Block a user