From b21a20ca16bd342dfc609a5b25fb0fe63f992715 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Thu, 22 Dec 2016 10:41:50 +0100 Subject: [PATCH] replace castclass by IsInst when sure it's not null --- src/Instantiator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.47.3