Repository navigation
JIT: Change to a compile-time diagnostic for avoiding heap allocations - #137624
Merged
Merged
Conversation
The LLM found a way to turn the assert in the heap allocators into a compile-time diagnostic, by redeclaring them with a `deprecated` attribute. This avoids potential dynamic linking issues on Linux. Fix dotnet#137487
|
Azure Pipelines: Successfully started running 6 pipeline(s). 9 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
jakobbotsch
marked this pull request as ready for review
November 17, 2026 07:22
Member
Author
|
PTAL @dotnet/jit-contrib |
AndyAyersMS
approved these changes
Nov 17, 2026
This was referenced Nov 17, 2026
Member
Author
|
/ba-g Test failure is the one fixed by #137730 |
jakobbotsch
added a commit
to jakobbotsch/runtime
that referenced
this pull request
Nov 19, 2026
dotnet#137624 stopped `utilcode.h` from including `corhlprpriv.h` in the JIT. As a result, `corhlpr.h` (and with it the UCRT `<assert.h>`) was first included after `host.h`, replacing the JIT's `assert` with the CRT one. Include `corhlpr.h` before `host.h` in `jit.h`, and mark `_wassert` as deprecated in DEBUG MSVC builds so a later CRT `<assert.h>` that replaces the JIT's `assert` fails the build. Co-authored-by: Copilot <[email protected]> Copilot-Session: c6ad27fe-95af-450c-8689-8aba56c073cf
jakobbotsch
added a commit
that referenced
this pull request
Nov 19, 2026
#137624 stopped `utilcode.h` from including `corhlprpriv.h` in the JIT. As a result, `corhlpr.h` (and with it the UCRT `<assert.h>`) was first included after `host.h`, replacing the JIT's `assert` with the CRT one. Remove the include eexcp.h from gcinfoencoder.h which is what ends up defining C assert. It does not seem to be necessary anymore. Deprecate the `_wassert` symbol to detect this happening in the future. Co-authored-by: Copilot <[email protected]>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The LLM found a way to turn the assert in the heap allocators into a compile-time diagnostic, by redeclaring them with a
deprecatedattribute. This avoids potential dynamic linking issues on Linux.Fix #137487