Browse Source

Fix #3103: unaligned.stobj cannot be transformed into inline assignment

pull/3111/head
Siegfried Pammer 2 years ago
parent
commit
d5cec0ab37
  1. 3
      ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs

3
ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs

@ -132,6 +132,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -132,6 +132,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms
}
if (block.Instructions[nextPos] is StObj stobj)
{
// unaligned.stobj cannot be inlined in C#
if (stobj.UnalignedPrefix > 0)
return false;
if (!stobj.Value.MatchLdLoc(inst.Variable))
return false;
if (!SemanticHelper.IsPure(stobj.Target.Flags) || inst.Variable.IsUsedWithin(stobj.Target))

Loading…
Cancel
Save