JIT: Ensure proper alignment of async resumption data section#121790
Merged
jakobbotsch merged 1 commit intodotnet:mainfrom Nov 24, 2025
Merged
JIT: Ensure proper alignment of async resumption data section#121790jakobbotsch merged 1 commit intodotnet:mainfrom
jakobbotsch merged 1 commit intodotnet:mainfrom
Conversation
We did not properly ensure the alignment of the async resumption data section, only the overall alignment of the data section. Unify the code that inserts padding and use it for the async resumption data too. The alignment was also missing for basic block address sections, but we did not have a problem here because we do not use absolute basic block addresses for 64-bit targets.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an alignment issue in the JIT emitter by ensuring the async resumption data section is properly aligned. The fix refactors the alignment logic into a new dedicated function that can be reused across different data section types.
Key changes:
- Extracted alignment logic into a new
emitEnsureDataSectionAlignmentfunction - Applied proper alignment to async resumption data sections
- Added alignment logic to basic block table data sections
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/coreclr/jit/emitpub.h | Adds declaration for new emitEnsureDataSectionAlignment function |
| src/coreclr/jit/emit.cpp | Refactors alignment logic into new function, applies it to async resumption and BB table data, fixes array pointer usage |
Member
Author
|
cc @dotnet/jit-contrib PTAL @kg |
Member
Author
|
Ping @kg / @dotnet/jit-contrib |
Member
|
LGTM |
kg
approved these changes
Nov 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We did not properly ensure the alignment of the async resumption data blob, only the overall alignment of the entire data section.
Unify the code that inserts padding and use it for the async resumption data too.
The alignment was also missing for basic block address sections, but we did not have a problem here because we do not use absolute basic block addresses for 64-bit targets. Still, add the code to ensure this would get aligned correctly.
Fix #121779