Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert at ICSharpCode.Decompiler.CSharp.Transforms.TransformFieldAndConstructorInitializers.HandleInstanceFieldInitializers #3310

Closed
greenozon opened this issue Oct 23, 2024 · 1 comment
Labels
Bug Decompiler The decompiler engine itself

Comments

@greenozon
Copy link

Input code

Save as proj: "c:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Build.Tasks.dll"

Erroneous output

Error decompiling for 'System.Xaml\XamlObjectReader.cs'
in assembly "C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Build.Tasks.dll"
 ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at ICSharpCode.Decompiler.CSharp.Transforms.TransformFieldAndConstructorInitializers.HandleInstanceFieldInitializers(IEnumerable`1 members) in TransformFieldAndConstructorInitializers.cs:line 206
   at ICSharpCode.Decompiler.CSharp.Transforms.TransformFieldAndConstructorInitializers.VisitTypeDeclaration(TypeDeclaration typeDeclaration) in TransformFieldAndConstructorInitializers.cs:line 168
   at ICSharpCode.Decompiler.CSharp.Syntax.TypeDeclaration.AcceptVisitor(IAstVisitor visitor) in TypeDeclaration.cs:line 137
   at ICSharpCode.Decompiler.CSharp.Syntax.DepthFirstAstVisitor.VisitChildren(AstNode node) in DepthFirstAstVisitor.cs:line 43
   at ICSharpCode.Decompiler.CSharp.Syntax.DepthFirstAstVisitor.VisitTypeDeclaration(TypeDeclaration typeDeclaration) in DepthFirstAstVisitor.cs:line 147
   at ICSharpCode.Decompiler.CSharp.Transforms.TransformFieldAndConstructorInitializers.VisitTypeDeclaration(TypeDeclaration typeDeclaration) in TransformFieldAndConstructorInitializers.cs:line 171
   at ICSharpCode.Decompiler.CSharp.Syntax.TypeDeclaration.AcceptVisitor(IAstVisitor visitor) in TypeDeclaration.cs:line 137
   at ICSharpCode.Decompiler.CSharp.Syntax.DepthFirstAstVisitor.VisitChildren(AstNode node) in DepthFirstAstVisitor.cs:line 43
   at ICSharpCode.Decompiler.CSharp.Syntax.DepthFirstAstVisitor.VisitNamespaceDeclaration(NamespaceDeclaration namespaceDeclaration) in DepthFirstAstVisitor.cs:line 142
   at ICSharpCode.Decompiler.CSharp.Syntax.NamespaceDeclaration.AcceptVisitor(IAstVisitor visitor) in NamespaceDeclaration.cs:line 140
   at ICSharpCode.Decompiler.CSharp.Syntax.DepthFirstAstVisitor.VisitChildren(AstNode node) in DepthFirstAstVisitor.cs:line 43
   at ICSharpCode.Decompiler.CSharp.Syntax.DepthFirstAstVisitor.VisitSyntaxTree(SyntaxTree syntaxTree) in DepthFirstAstVisitor.cs:line 57
   at ICSharpCode.Decompiler.CSharp.Syntax.SyntaxTree.AcceptVisitor(IAstVisitor visitor) in SyntaxTree.cs:line 128
   at ICSharpCode.Decompiler.CSharp.Transforms.TransformFieldAndConstructorInitializers.Run(AstNode node, TransformContext context) in TransformFieldAndConstructorInitializers.cs:line 55
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.RunTransforms(AstNode rootNode, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in CSharpDecompiler.cs:line 570
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DecompileTypes(IEnumerable`1 types) in CSharpDecompiler.cs:line 956
   at ICSharpCode.Decompiler.CSharp.ProjectDecompiler.WholeProjectDecompiler.<>c__DisplayClass46_0.<WriteCodeFilesInProject>b__5(IGrouping`2 file) in WholeProjectDecompiler.cs:line 289
-- continuing with outer exception (ICSharpCode.Decompiler.DecompilerException) --
   at ICSharpCode.Decompiler.CSharp.ProjectDecompiler.WholeProjectDecompiler.<>c__DisplayClass46_0.<WriteCodeFilesInProject>b__5(IGrouping`2 file) in WholeProjectDecompiler.cs:line 313
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) in offset 259
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() in offset 17
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw(Exception source) in offset 0
   at System.Threading.Tasks.Parallel.<>c__DisplayClass43_0`2.<PartitionerForEachWorker>b__1(IEnumerator& partitionState, Int64 timeout, Boolean& replicationDelegateYieldedBeforeCompletion) in offset 609
   at System.Threading.Tasks.TaskReplicator.Replica.Execute() in offset 35

Details

  • ILSpy version 9.0.0.7823-preview3+21e5d0f0349ff2858d24f768e0f88e40bab48272
    .NET version 8.0.8+08338fcaa5c9b9a8190abb99222fed12aaba956c

Microsoft.Windows.UI.Xaml.Build.Tasks.zip

@greenozon greenozon added Bug Decompiler The decompiler engine itself labels Oct 23, 2024
@greenozon
Copy link
Author

@siegfriedpammer it might be some kind of regression? I hit it on many other assemblies...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Decompiler The decompiler engine itself
Projects
None yet
Development

No branches or pull requests

1 participant