Skip to content
New issue

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

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

Already on GitHub? # to your account

ICSharpCode.ILSpy.AssertionFailedException: StackTypes must match! #3189

Closed
greenozon opened this issue Mar 30, 2024 · 0 comments
Closed

ICSharpCode.ILSpy.AssertionFailedException: StackTypes must match! #3189

greenozon opened this issue Mar 30, 2024 · 0 comments
Labels
Bug Decompiler The decompiler engine itself

Comments

@greenozon
Copy link

Input code

Please provide the input that failed to decompile.
Save as Project

Erroneous output

Error decompiling @06000049 ------------
in assembly "C:\tmp\1\err142.dll"
 ---> ICSharpCode.ILSpy.AssertionFailedException: StackTypes must match!
   at ICSharpCode.ILSpy.ILSpyTraceListener.Fail(String message, String detailMessage) in offset 379
   at System.Diagnostics.TraceInternal.Fail(String message, String detailMessage) in offset 48
   at System.Diagnostics.Debug.Fail(String message, String detailMessage) in offset 0
   at ICSharpCode.Decompiler.IL.Transforms.TransformExpressionTrees.<>c__DisplayClass16_0.<ConvertInstruction>g__DoConvert|0() in TransformExpressionTrees.cs:line 281
   at ICSharpCode.Decompiler.IL.Transforms.TransformExpressionTrees.<>c__DisplayClass29_0.<ConvertComparison>b__1() in TransformExpressionTrees.cs:line 791
   at ICSharpCode.Decompiler.IL.Transforms.TransformExpressionTrees.<>c__DisplayClass16_0.<ConvertInstruction>g__DoConvert|0() in TransformExpressionTrees.cs:line 279
   at ICSharpCode.Decompiler.IL.Transforms.TransformExpressionTrees.<>c__DisplayClass12_0.<ConvertLambda>g__BuildFunction|0() in TransformExpressionTrees.cs:line 184
   at ICSharpCode.Decompiler.IL.Transforms.TransformExpressionTrees.TryConvertExpressionTree(ILInstruction instruction, ILInstruction statement) in TransformExpressionTrees.cs:line 136
   at ICSharpCode.Decompiler.IL.Transforms.TransformExpressionTrees.TryConvertExpressionTree(ILInstruction instruction, ILInstruction statement) in TransformExpressionTrees.cs:line 147
   at ICSharpCode.Decompiler.IL.Transforms.TransformExpressionTrees.Run(Block block, Int32 pos, StatementTransformContext context) in TransformExpressionTrees.cs:line 118
   at ICSharpCode.Decompiler.IL.Transforms.StatementTransform.Run(Block block, BlockTransformContext context) in StatementTransform.cs:line 140
   at ICSharpCode.Decompiler.IL.Block.RunTransforms(IEnumerable`1 transforms, BlockTransformContext context) in Block.cs:line 333
   at ICSharpCode.Decompiler.IL.Transforms.BlockILTransform.VisitBlock(ControlFlowNode entryNode, BlockTransformContext context) in BlockTransform.cs:line 136
   at ICSharpCode.Decompiler.IL.Transforms.BlockILTransform.Run(ILFunction function, ILTransformContext context) in BlockTransform.cs:line 100
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DecompileBody(IMethod method, EntityDeclaration entityDecl, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in CSharpDecompiler.cs:line 1737
-- continuing with outer exception (ICSharpCode.Decompiler.DecompilerException) --
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DecompileBody(IMethod method, EntityDeclaration entityDecl, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in CSharpDecompiler.cs:line 1773
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DoDecompile(IMethod method, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in CSharpDecompiler.cs:line 1622
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.<>c__DisplayClass74_0.<DoDecompile>g__DoDecompileMember|0(IEntity entity, RecordDecompiler recordDecompiler, PartialTypeInfo partialType) in CSharpDecompiler.cs:line 1497
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DoDecompile(ITypeDefinition typeDef, DecompileRun decompileRun, ITypeResolveContext decompilationContext) in CSharpDecompiler.cs:line 1364
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DoDecompileTypes(IEnumerable`1 types, DecompileRun decompileRun, ITypeResolveContext decompilationContext, SyntaxTree syntaxTree) in CSharpDecompiler.cs:line 651
   at ICSharpCode.Decompiler.CSharp.CSharpDecompiler.DecompileTypes(IEnumerable`1 types) in CSharpDecompiler.cs:line 950
   at ICSharpCode.Decompiler.CSharp.ProjectDecompiler.WholeProjectDecompiler.<>c__DisplayClass46_0.<WriteCodeFilesInProject>b__5(IGrouping`2 file) in WholeProjectDecompiler.cs:line 276
   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

  • Product in use: e.g. ILSpy / ICSharpCode.Decompiler nuget package / VS extension
  • ILSpy version 9.0.0.7612-preview1
  • .NET version 8.0.3+9f4b1f5d664afdfc80e1508ab7ed099dff210fbd

err142.zip

@greenozon greenozon added Bug Decompiler The decompiler engine itself labels Mar 30, 2024
mattsh247 pushed a commit to mattsh247/ILSpy that referenced this issue Jul 30, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Bug Decompiler The decompiler engine itself
Projects
None yet
Development

No branches or pull requests

1 participant