Skip to content

JIT: Mark non-internal block as imported#122967

Merged
jakobbotsch merged 1 commit intodotnet:mainfrom
jakobbotsch:fix-122963
Jan 9, 2026
Merged

JIT: Mark non-internal block as imported#122967
jakobbotsch merged 1 commit intodotnet:mainfrom
jakobbotsch:fix-122963

Conversation

@jakobbotsch
Copy link
Member

The JIT has some debug checking that validates that non-internal blocks are always marked BBF_IMPORTED. We introduce such a block in the async rewrite (it should not be internal due to debug info), so make sure we uphold that invariant.

The check happens here:

/* no un-imported blocks */
if (!block->HasFlag(BBF_IMPORTED))
{
/* internal blocks do not count */
if (!block->HasFlag(BBF_INTERNAL))
{
noway_assert(!"Non IMPORTED block not removed!");
}
}

Fix #122963

The JIT has some debug checking that validates that non-internal blocks
are always marked `BBF_IMPORTED`. We introduce such a block in the async
rewrite (it should not be internal due to debug info), so make sure we
uphold that invariant.
Copilot AI review requested due to automatic review settings January 7, 2026 12:01
@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jan 7, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a JIT assertion failure by ensuring that non-internal blocks are always marked with the BBF_IMPORTED flag. When the async transformation creates a new block to rethrow exceptions and removes its BBF_INTERNAL flag (to preserve debug info), it must also set BBF_IMPORTED to maintain the JIT invariant that all non-internal blocks must be marked as imported.

Key Changes

  • Added SetFlags(BBF_IMPORTED) call after removing BBF_INTERNAL flag in async.cpp

@jakobbotsch
Copy link
Member Author

PTAL @dotnet/jit-contrib

@jakobbotsch jakobbotsch requested a review from a team January 9, 2026 13:50
@jakobbotsch
Copy link
Member Author

/ba-g iOS dead letter

@jakobbotsch jakobbotsch merged commit b2bd00a into dotnet:main Jan 9, 2026
131 of 134 checks passed
@jakobbotsch jakobbotsch deleted the fix-122963 branch January 9, 2026 14:16
@github-actions github-actions bot locked and limited conversation to collaborators Feb 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI runtime-async

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JIT: Assertion failed '!"Non IMPORTED block not removed!"' in 'Async2SimpleEH:TestDefinesIntButThrowsAsync():int' during 'Global local var liveness'

3 participants