From 4a862daa5cce710445809ac349dd67dbcb54b2e1 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 23 Aug 2014 19:09:32 +0200 Subject: [PATCH] Support stind and ldobj instructions --- ICSharpCode.Decompiler/IL/ILReader.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ICSharpCode.Decompiler/IL/ILReader.cs b/ICSharpCode.Decompiler/IL/ILReader.cs index 9066c4112..85a9da580 100644 --- a/ICSharpCode.Decompiler/IL/ILReader.cs +++ b/ICSharpCode.Decompiler/IL/ILReader.cs @@ -492,14 +492,21 @@ namespace ICSharpCode.Decompiler.IL case ILOpCode.Starg_S: return Starg(reader.ReadByte()); case ILOpCode.Stind_I1: + return new StObj(value: Pop(), target: Pop(), type: typeSystem.SByte); case ILOpCode.Stind_I2: + return new StObj(value: Pop(), target: Pop(), type: typeSystem.Int16); case ILOpCode.Stind_I4: + return new StObj(value: Pop(), target: Pop(), type: typeSystem.Int32); case ILOpCode.Stind_I8: + return new StObj(value: Pop(), target: Pop(), type: typeSystem.Int64); case ILOpCode.Stind_R4: + return new StObj(value: Pop(), target: Pop(), type: typeSystem.Single); case ILOpCode.Stind_R8: + return new StObj(value: Pop(), target: Pop(), type: typeSystem.Double); case ILOpCode.Stind_I: + return new StObj(value: Pop(), target: Pop(), type: typeSystem.IntPtr); case ILOpCode.Stind_Ref: - throw new NotImplementedException(); + return new StObj(value: Pop(), target: Pop(), type: typeSystem.Object); case ILOpCode.Stloc: return Stloc(reader.ReadUInt16()); case ILOpCode.Stloc_S: @@ -557,7 +564,7 @@ namespace ICSharpCode.Decompiler.IL case ILOpCode.Ldlen: return new LdLen(Pop()); case ILOpCode.Ldobj: - throw new NotImplementedException(); + return new LdObj(Pop(), (TypeReference)ReadAndDecodeMetadataToken()); case ILOpCode.Ldsfld: return new LdsFld((FieldReference)ReadAndDecodeMetadataToken()); case ILOpCode.Ldsflda: