Skip to content

Conversation

@jkotas
Copy link
Member

@jkotas jkotas commented Dec 7, 2025

The undocumented -ERR mode is meant to ignore errors and allow produce invalid binaries for test purposes. Print the errors as warnings in this mode so that they do not fail the build.

The undocumented -ERR mode is meant to ignore errors and allow produce invalid binaries
for test purposes. Print the errors as warnings in this mode so that
they do not fail the build.
Copilot AI review requested due to automatic review settings December 7, 2025 06:40
@jkotas jkotas requested a review from jkoritzinsky December 7, 2025 06:40
@jkotas
Copy link
Member Author

jkotas commented Dec 7, 2025

Contributes to #122056

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT
See info in area-owners.md if you want to be subscribed.

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 implements a fix for the undocumented -ERR mode in ilasm, which is designed to allow production of invalid binaries for testing purposes. The change ensures that errors are printed as warnings in this mode to prevent build failures.

  • Modified the AsmParse::error() function to output "warning :" instead of "error :" when the -ERR flag is enabled

@jkotas
Copy link
Member Author

jkotas commented Dec 13, 2025

@jkoritzinsky PTLA. We will want to match this in managed ilasm.

@jkoritzinsky
Copy link
Member

I believe System.Reflection.Metadata allows us to emit invalid-enough stuff to enable these scenarios, so we should be able to replicate this behavior.

@jkotas jkotas merged commit 05b94f1 into dotnet:main Dec 14, 2025
121 of 123 checks passed
@jkotas jkotas deleted the ilasm-err branch December 14, 2025 03:43
@github-actions github-actions bot locked and limited conversation to collaborators Jan 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants