Browse Source

Fix UsingTransform

pull/1165/head
Siegfried Pammer 7 years ago
parent
commit
4b7c82957a
  1. 5
      ICSharpCode.Decompiler/IL/Transforms/UsingTransform.cs

5
ICSharpCode.Decompiler/IL/Transforms/UsingTransform.cs

@ -277,7 +277,10 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -277,7 +277,10 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return false;
if (callVirt.Arguments.Count != 1)
return false;
return target.MatchLdLocRef(objVar) || (boxedValue && target.MatchLdLoc(objVar)) || (usingNull && callVirt.Arguments[0].MatchLdNull());
return target.MatchLdLocRef(objVar)
|| (boxedValue && target.MatchLdLoc(objVar))
|| (usingNull && callVirt.Arguments[0].MatchLdNull())
|| (target.MatchIsInst(out var arg, out var type2) && arg.MatchLdLoc(objVar) && type2.IsKnownType(KnownTypeCode.IDisposable));
}
}
}

Loading…
Cancel
Save