-
Notifications
You must be signed in to change notification settings - Fork 385
Respect repr(align) on functions #4282
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
Labels
A-interpreter
Area: affects the core interpreter
C-bug
Category: This is a bug.
I-wrong
Impact: makes Miri produce incorrect program behavior
Comments
ChrisDenton
added a commit
to ChrisDenton/rust
that referenced
this issue
Apr 22, 2025
handle function alignment in miri tracking issue: rust-lang#82232 Fixes rust-lang/miri#4282 The `#[repr(align(N))]` attribute on functions was ignored when using miri. For such a function, its address should be a multiple of `N`. There is some further discussion in the thread [#t-compiler/const-eval > function address alignment](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/function.20address.20alignment) on how `dyn Fn` should be handled. The behavior there appears to be consistent between miri and nightly, though both may be incorrect. In any case, that can be resolved separately.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Apr 23, 2025
Rollup merge of rust-lang#140072 - folkertdev:miri-fn-align, r=RalfJung handle function alignment in miri tracking issue: rust-lang#82232 Fixes rust-lang/miri#4282 The `#[repr(align(N))]` attribute on functions was ignored when using miri. For such a function, its address should be a multiple of `N`. There is some further discussion in the thread [#t-compiler/const-eval > function address alignment](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/function.20address.20alignment) on how `dyn Fn` should be handled. The behavior there appears to be consistent between miri and nightly, though both may be incorrect. In any case, that can be resolved separately.
github-actions bot
pushed a commit
that referenced
this issue
Apr 23, 2025
handle function alignment in miri tracking issue: rust-lang/rust#82232 Fixes #4282 The `#[repr(align(N))]` attribute on functions was ignored when using miri. For such a function, its address should be a multiple of `N`. There is some further discussion in the thread [#t-compiler/const-eval > function address alignment](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/function.20address.20alignment) on how `dyn Fn` should be handled. The behavior there appears to be consistent between miri and nightly, though both may be incorrect. In any case, that can be resolved separately.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-interpreter
Area: affects the core interpreter
C-bug
Category: This is a bug.
I-wrong
Impact: makes Miri produce incorrect program behavior
There's a
#[repr(align(N))]
attribute on functions (rust-lang/rust#82232). Miri currently ignores this when assigning addresses to functions; we should fix that.The text was updated successfully, but these errors were encountered: