-
Notifications
You must be signed in to change notification settings - Fork 13.5k
error out when repr(align)
exceeds COFF limit
#142638
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
base: master
Are you sure you want to change the base?
Conversation
rustbot has assigned @WaffleLapkin. Use |
Some changes occurred in diagnostic error codes Some changes occurred in compiler/rustc_passes/src/check_attr.rs |
This comment has been minimized.
This comment has been minimized.
The PE-COFF binary format limits section alignment to 8192 bytes. Emit error when alignment exceeds this limit to avoid crash in llvm.
The job Click to see the possible cause of the failure (guessed by this bot)
|
It only needs to error if we generate a |
Could you include testing alignment on functions here in this PR (if relevant, but I suspect it is). I think you can just add it to the test files you already modify. #![feature(fn_align)]
// ...
// and then you can annotate a function with `#[repr(align(N))]`
#[repr(align(16))]
fn foo() {} |
@nthery This simple version that rejects |
...wait, we can't crater for Windows. |
fbbth. |
☔ The latest upstream changes (presumably #138165) made this pull request unmergeable. Please resolve the merge conflicts. |
It is relevant indeed. I reproduced the original bug with a function alignment exceeding 0x2000 bytes. Thanks for spotting this. I will add some test points. |
The PE-COFF binary format limits section alignment to 8192 bytes. Emit error when alignment exceeds this limit to avoid crash in llvm.
Closes #142386.