Skip to content

Commit

Permalink
Fix #3070 stack order on block reimport
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrunwald committed Sep 29, 2023
1 parent 5206aef commit d2d1c33
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ICSharpCode.Decompiler/IL/ILReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public bool MergeStackTypes(ImmutableStack<ILVariable> newEdge)
a = a.Pop();
b = b.Pop();
}
output.Reverse(); // restore correct stack order
this.InputStack = ImmutableStack.CreateRange(output);
this.ImportStarted = false;
return true;
Expand Down Expand Up @@ -492,6 +493,7 @@ void ReadBlock(ImportedBlock block, CancellationToken cancellationToken)
block.ResetForReimport();
block.ImportStarted = true;
reader.Offset = block.StartILOffset;
//Debug.WriteLine($"Import block at IL_{block.StartILOffset:x4} with inputs {string.Join(", ", block.InputStack.Select(v => v.StackType.ToString()))}");
currentBlock = block;
currentStack = block.InputStack;
// Read instructions until we reach the end of the block.
Expand Down

0 comments on commit d2d1c33

Please sign in to comment.