Closed eboasson closed 8 years ago
I also encountered the same problem, and @eboasson's patch above fixed the issue.
@eboasson Thanks for the report. I'll try to look at this this weekend.
Thanks for this: the fix turned out to involve a tiny bit more (mostly to do with sizing for bitfields), but I've added a test case to make sure this doesn't break again.
It appears the padding of a struct to make its size a multiple of its alignment doesn't happen. This also means embedding a struct for which this happens in another struct causes any subsequent fields to have incorrect offsets. Attached is a simple case that triggers it.
A minor change makes this case (and my actual problem go away):
bug.zip