From 704af021ffcdcf64ea2095b2ca0a6fd5617bf6a3 Mon Sep 17 00:00:00 2001 From: Sentinel209_cp <5b554accd9e292fcb886b205d8d4c32c5d52ce2df5Ng6vpx> Date: Sat, 25 Oct 2014 12:47:56 +0000 Subject: [PATCH] Compiler fix for the Isinst OpCode. --- source2/IL2CPU/Cosmos.IL2CPU/ILOpCodes/OpField.cs | 3 ++- source2/IL2CPU/Cosmos.IL2CPU/ILOpCodes/OpType.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source2/IL2CPU/Cosmos.IL2CPU/ILOpCodes/OpField.cs b/source2/IL2CPU/Cosmos.IL2CPU/ILOpCodes/OpField.cs index 2de8a0412..f7476398f 100644 --- a/source2/IL2CPU/Cosmos.IL2CPU/ILOpCodes/OpField.cs +++ b/source2/IL2CPU/Cosmos.IL2CPU/ILOpCodes/OpField.cs @@ -174,7 +174,8 @@ namespace Cosmos.IL2CPU.ILOpCodes { { return; } - throw new Exception("Wrong Poptype encountered!"); + throw new Exception("Wrong Poptype encountered! (Type = " + StackPopTypes[0].FullName + ", expected = " + expectedType.FullName + ")"); + // throw new Exception("Wrong Poptype encountered!"); case Code.Stsfld: if (StackPopTypes[0] == null) { diff --git a/source2/IL2CPU/Cosmos.IL2CPU/ILOpCodes/OpType.cs b/source2/IL2CPU/Cosmos.IL2CPU/ILOpCodes/OpType.cs index 5be8dbeb6..a02127d5e 100644 --- a/source2/IL2CPU/Cosmos.IL2CPU/ILOpCodes/OpType.cs +++ b/source2/IL2CPU/Cosmos.IL2CPU/ILOpCodes/OpType.cs @@ -105,7 +105,7 @@ namespace Cosmos.IL2CPU.ILOpCodes { return; case Code.Isinst: StackPopTypes[0] = typeof(object); - StackPushTypes[0] = typeof(bool); + StackPushTypes[0] = Value; return; case Code.Castclass: if (Value.IsGenericType &&