Skip to content

Commit

Permalink
Fix handling of padding in OBJECT_ALL_INFORMATION accessor
Browse files Browse the repository at this point in the history
  • Loading branch information
hillu committed Oct 20, 2021
1 parent 6558c89 commit 5258fbf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion object.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ func (oi *ObjectAllInformationT) GetObjectTypeInformation() []*ObjectTypeInforma
types = append(types, current)
offset += unsafe.Sizeof(ObjectTypeInformationT{}) + uintptr(current.TypeName.MaximumLength)
// padding
offset = (offset & unsafe.Sizeof(uintptr(0))) + unsafe.Sizeof(uintptr(0))
if rest := offset % unsafe.Sizeof(uintptr(0)); rest != 0 {
offset += unsafe.Sizeof(uintptr(0)) - rest
}
}
return types
}
Expand Down

0 comments on commit 5258fbf

Please sign in to comment.