From: jpbruyere Date: Thu, 22 Dec 2016 09:41:50 +0000 (+0100) Subject: replace castclass by IsInst when sure it's not null X-Git-Tag: v0.5.1~63^2~15 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=b21a20ca16bd342dfc609a5b25fb0fe63f992715;p=jp%2Fcrow.git replace castclass by IsInst when sure it's not null --- diff --git a/src/Instantiator.cs b/src/Instantiator.cs index 90cb8045..d4178dbf 100644 --- a/src/Instantiator.cs +++ b/src/Instantiator.cs @@ -1124,7 +1124,7 @@ namespace Crow if (dstType.IsValueType) il.Emit (OpCodes.Unbox_Any, dstType); else - il.Emit (OpCodes.Castclass, dstType); + il.Emit (OpCodes.Isinst, dstType); il.Emit (OpCodes.Br, endConvert); il.MarkLabel (convert);