Browse Source

Only try to inline stackalloc Span<T> if the next statement is a plain assignment.

pull/1596/head
Siegfried Pammer 7 years ago
parent
commit
6a1229028c
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs

2
ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs

@ -283,7 +283,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
stmt = stmt.Parent; stmt = stmt.Parent;
} }
// Special case to eliminate extra store // Special case to eliminate extra store
if (stmt.GetNextSibling() is StLoc) if (stmt.GetNextSibling() is StLoc storeStmt && storeStmt.Value is LdLoc)
ILInlining.InlineIfPossible(block, stmt.ChildIndex, context); ILInlining.InlineIfPossible(block, stmt.ChildIndex, context);
return; return;
} }

Loading…
Cancel
Save