JIT: Fix calculation of opcodeOffsets in Compiler::impImportBlockCode
authorKonstantin Baladurin <k.baladurin@partner.samsung.com>
Thu, 6 Jul 2017 11:21:42 +0000 (14:21 +0300)
committerKonstantin Baladurin <k.baladurin@partner.samsung.com>
Wed, 30 Aug 2017 14:17:18 +0000 (17:17 +0300)
Commit migrated from https://github.com/dotnet/coreclr/commit/e6167a0742157f152c399fd390a0d41d62edff2a

src/coreclr/src/jit/importer.cpp

index e325d05..4774c24 100644 (file)
@@ -9972,9 +9972,9 @@ void Compiler::impImportBlockCode(BasicBlock* block)
             } cval;
 
             case CEE_PREFIX1:
-                opcode = (OPCODE)(getU1LittleEndian(codeAddr) + 256);
-                codeAddr += sizeof(__int8);
+                opcode     = (OPCODE)(getU1LittleEndian(codeAddr) + 256);
                 opcodeOffs = (IL_OFFSET)(codeAddr - info.compCode);
+                codeAddr += sizeof(__int8);
                 goto DECODE_OPCODE;
 
             SPILL_APPEND:
@@ -12448,9 +12448,9 @@ void Compiler::impImportBlockCode(BasicBlock* block)
                 impValidateMemoryAccessOpcode(codeAddr, codeEndp, false);
 
             PREFIX:
-                opcode = (OPCODE)getU1LittleEndian(codeAddr);
-                codeAddr += sizeof(__int8);
+                opcode     = (OPCODE)getU1LittleEndian(codeAddr);
                 opcodeOffs = (IL_OFFSET)(codeAddr - info.compCode);
+                codeAddr += sizeof(__int8);
                 goto DECODE_OPCODE;
 
             case CEE_VOLATILE: