[ilasm] Fix AsmParse::error to always write to stderr#127339
Conversation
…om PR #125320 Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/c22bcf9e-557c-49cc-aa89-0e9ce13e9895 Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
|
Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib |
There was a problem hiding this comment.
Pull request overview
Updates native ilasm parsing diagnostics so AsmParse::error() behaves like AsmParse::warn() under -ERR (error-tolerant) mode, reducing unwanted diagnostic output and ensuring consistent stderr usage.
Changes:
- Suppress
AsmParse::error()output whenassem->OnErrGo(-ERR) is enabled. - Simplify error output stream selection to always use
stderr(when output is emitted).
Build/test status: Not run as part of this review.
🤖 Copilot Code Review — PR #127339Note This review was generated by Copilot and validated across two model families (Claude Opus 4.6 primary, GPT-5.3-Codex secondary). Holistic AssessmentMotivation: Making Approach: Minimal, targeted change to a single function. The early return was explicitly authored by Summary: ✅ LGTM. The change is correct and well-motivated. The Detailed Findings✅ Early return safety —
|
@copilot Clean this up |
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/4d756fde-61d9-46e9-9da8-dd00da09f67e Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/55305342-7494-4b3d-b27c-fd933da916e1 Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Done in 37e39b1. Removed all 7 |
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/302eec63-31c8-415e-a964-5d7cd93009be Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/ba-g unrelated known failures |
This applies the same fix to
AsmParse::errorthat was made toAsmParse::warnin #125320: suppress error output when the-ERRcommand line switch (assem->OnErrGo) is enabled, and always usestderrfor output when diagnostics are emitted.Additionally:
assem->OnErrGo ? "warning : " : "error : "conditional prefix (dead code after the early return) has been simplified to a fixed"error : "string.assembler.cpp, the 7 call sites that previously usedif(OnErrGo) report->error(...); else { report->warn(...); /* fixup */ }have been cleaned up. Each is nowif(!OnErrGo) { report->warn(...); /* fixup */ }— whenOnErrGois set, neither the diagnostic nor the fixup is applied (preserving the original invalid output), and when not set, the warning is emitted and the fixup is applied as before.Note
This PR description was generated with the assistance of GitHub Copilot.