diff options
Diffstat (limited to 'rocks')
-rw-r--r-- | rocks/Mono.Cecil.Rocks/ILParser.cs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/rocks/Mono.Cecil.Rocks/ILParser.cs b/rocks/Mono.Cecil.Rocks/ILParser.cs index 6f745bc..4a5be3b 100644 --- a/rocks/Mono.Cecil.Rocks/ILParser.cs +++ b/rocks/Mono.Cecil.Rocks/ILParser.cs @@ -79,8 +79,6 @@ namespace Mono.Cecil.Rocks { var context = CreateContext (method, visitor); var code = context.Code; - code.MoveTo (method.RVA); - var flags = code.ReadByte (); switch (flags & 0x3) { @@ -89,7 +87,7 @@ namespace Mono.Cecil.Rocks { ParseCode (code_size, context); break; case 0x3: // fat - code.position--; + code.Advance (-1); ParseFatMethod (context); break; default: @@ -99,7 +97,7 @@ namespace Mono.Cecil.Rocks { static ParseContext CreateContext (MethodDefinition method, IILVisitor visitor) { - var code = method.Module.Read (method, (_, reader) => new CodeReader (reader.image.MetadataSection, reader)); + var code = method.Module.Read (method, (m, reader) => new CodeReader (method, reader)); return new ParseContext { Code = code, @@ -128,10 +126,10 @@ namespace Mono.Cecil.Rocks { var metadata = context.Metadata; var visitor = context.Visitor; - var start = code.position; + var start = code.Position; var end = start + code_size; - while (code.position < end) { + while (code.Position < end) { var il_opcode = code.ReadByte (); var opcode = il_opcode != 0xfe ? OpCodes.OneByteOpCode [il_opcode] |