mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00: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
1 changed files with 3 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue