Skip to content

Commit

Permalink
Fix icsharpcode#3103: unaligned.stobj cannot be transformed into inli…
Browse files Browse the repository at this point in the history
…ne assignment
  • Loading branch information
siegfriedpammer authored and matt committed Jul 30, 2024
1 parent 8bd5a6f commit 7d0e4f2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ bool TransformInlineAssignmentStObjOrCall(Block block, int pos)
}
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))
Expand Down

0 comments on commit 7d0e4f2

Please sign in to comment.