Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't place a member in the remaining space of a bitfield. #734

Closed
emilio opened this issue Jun 3, 2017 · 0 comments
Closed

Can't place a member in the remaining space of a bitfield. #734

emilio opened this issue Jun 3, 2017 · 0 comments
Labels

Comments

@emilio
Copy link
Contributor

emilio commented Jun 3, 2017

I discovered this while investigating #726.

There's one test in our test suite that uncovers this, in bitfield_align.h (Date2). We were not getting the offsets correctly for that struct, so we managed to pack it and the remaining byte was generated correctly.

When implementing proper bitfield padding, that struct starting failing its test.

Input C/C++ Header

struct Test1 {
    unsigned long foo: 45;
    unsigned char byte;
};

Expected Results

Struct should pass tests and have the correct alignment.

Actual Results

We generate an extra byte member, because we can't put it in the last aligned slot in the space that the bitfield would take.

@emilio emilio added the bug label Jun 3, 2017
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Jun 17, 2017
MozReview-Commit-ID: Fbng9a7MpDM

--HG--
extra : rebase_source : 60ccd60db3292232a32194f547481eaa3d089192
aethanyc pushed a commit to aethanyc/gecko-dev that referenced this issue Jun 19, 2017
JerryShih pushed a commit to JerryShih/gecko-dev that referenced this issue Jun 19, 2017
jryans pushed a commit to jryans/gecko-dev that referenced this issue Jun 20, 2017
Manishearth pushed a commit to Manishearth/gecko-dev that referenced this issue Jun 23, 2017
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 1, 2019
MozReview-Commit-ID: Fbng9a7MpDM

UltraBlame original commit: 956c34d23e871a77ee33916829e9acc83c35c266
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 1, 2019
MozReview-Commit-ID: Fbng9a7MpDM

UltraBlame original commit: 956c34d23e871a77ee33916829e9acc83c35c266
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 1, 2019
MozReview-Commit-ID: Fbng9a7MpDM

UltraBlame original commit: 956c34d23e871a77ee33916829e9acc83c35c266
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant