Skip to content

Commit

Permalink
Fix #3103: unaligned.stobj cannot be transformed into inline assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
siegfriedpammer committed Oct 17, 2023
1 parent ea8b0fb commit d5cec0a
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 d5cec0a

Please # to comment.