project-everest / everparse

Automated generation of provably secure, zero-copy parsers from format specifications
https://project-everest.github.io/everparse
Apache License 2.0
251 stars 15 forks source link

Two bug fixes #109

Closed nikswamy closed 1 year ago

nikswamy commented 1 year ago
//bitfield boundaries coincide with the the types of their underlying fields
typedef struct _BFBoundary {
   UINT16 x : 12; //4 bits of padding here are implicit
   UINT8 y : 4;
   UINT8 z : 3; //y and z are packed, but with 1 bit of padding left
   UINT16 w : 12; //4 bits of padding here are implicit
} BFBoundary;

since the field y could be packed into the 16 bit field that contains x, but y has a different type than x. Now, it is accepted.

Thanks to @Smfakhoury for finding these issues.