Repository navigation
[Compiler tests] Added C990 for the analyzer/.editorconfig crash fixed in #2098 - #2099
Merged
RobertvanderHulst merged 1 commit intoOct 11, 2026
Conversation
…d in X-Sharp#2098 C990 compiles VO code with a literal symbol together with /analyzer and /analyzerconfig. That combination produced two compiler generated syntax trees and crashed xsc with an IndexOutOfRangeException before X-Sharp#2098. The test needs an analyzer that xsc can load, so this adds a small no-op analyzer (src/CompilerTests/Analyzers/XSharpTestAnalyzer) that is built against the XSharp.CodeAnalysis.dll of the tested compiler. runtests.cmd builds it into Bin\Analyzers before the tests run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Regression test for the crash fixed in #2098: with
/analyzerand/analyzerconfig,xsccrashed with anIndexOutOfRangeExceptioninCommonCompiler.UpdateAnalyzerConfigOptionsProviderwhen the compilation had two compiler generated syntax trees.What it adds
src/CompilerTests/Applications/C990: VO dialect, one literal symbol (#C990). The symbol makesProcessTreesgenerate a tree, and the VO dialect adds the default tree, so there are two generated trees. Its.editorconfigis passed with/analyzerconfig.xSharp Tests30.viproj: the C990 entry, in the C950-C999 group so that the runner picks it up (the NEW group is not run). ItsSwitchesadd/analyzer:Bin\Analyzers\XSharpTestAnalyzer.dll /analyzerconfig:Applications\C990\.editorconfig; both paths are relative tosrc\CompilerTests, the runner's working directory.src/CompilerTests/Analyzers/XSharpTestAnalyzer: a no-opDiagnosticAnalyzer([DiagnosticAnalyzer("X#")]). The crash only happens when at least one analyzer is loaded, andxsconly loads analyzers built againstXSharp.CodeAnalysis.dll; Roslyn analyzers such as the WinForms ones are ignored. The project (net472) referencesXSharp.CodeAnalysis.dll,System.Collections.Immutable.dllandSystem.Memory.dllfromArtifacts\Bin\xsc\Release\net472\, i.e. the compiler under test, so no binary is checked in.src/CompilerTests/runtests.cmd: builds the analyzer intoBin\Analyzers(dotnet build, Release) before the tests run.Bin\is git-ignored.Testing
Based on
dev@d6fa8d3001(includes #2098). Release build viasrc\buildcompiler.cmd Release, tests viaRunCompilertests.cmd.xsc.exe3.0.2.0 (without #2098)-532462766(unhandledIndexOutOfRangeException)Full suite with the compiler from this branch: fixed tests 1030, 22 runtime tests fail, all of which also fail on the 06.10 baseline (which had 25; C703, C901 and R832 pass now). Broken tests: 120 / 120 as expected.
🤖 Generated with Claude Code