Browse Source

fix bug in StObj-ExpressionTransform

pull/728/head
Siegfried Pammer 9 years ago
parent
commit
78d593f3ff
  1. 2
      ICSharpCode.Decompiler/IL/Transforms/ExpressionTransforms.cs

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

@ -123,7 +123,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
protected internal override void VisitStObj(StObj inst) protected internal override void VisitStObj(StObj inst)
{ {
ILVariable v; ILVariable v;
if (inst.Target.MatchLdLoca(out v) && TypeUtils.IsCompatibleTypeForMemoryAccess(v.Type, inst.Type) && inst.UnalignedPrefix == 0 && !inst.IsVolatile) { if (inst.Target.MatchLdLoca(out v) && TypeUtils.IsCompatibleTypeForMemoryAccess(new ByReferenceType(v.Type), inst.Type) && inst.UnalignedPrefix == 0 && !inst.IsVolatile) {
inst.ReplaceWith(new StLoc(v, inst.Value.Clone())); inst.ReplaceWith(new StLoc(v, inst.Value.Clone()));
} }
base.VisitStObj(inst); base.VisitStObj(inst);

Loading…
Cancel
Save