diff --git a/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs b/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs index c666467502..a24783d214 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/TransformAssignment.cs @@ -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))