Make sure we update nextByte when we decode NEXT_OPCODE in x86 GCinfo (#1299)
authorAndrew Au <andrewau@microsoft.com>
Sun, 5 Jan 2020 23:14:17 +0000 (15:14 -0800)
committerGitHub <noreply@github.com>
Sun, 5 Jan 2020 23:14:17 +0000 (15:14 -0800)
* Make sure we update nextByte when we decode NEXT_OPCODE in x86 GCinfo

* Update src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/InfoHdr.cs

Co-Authored-By: Jan Vorlicek <janvorli@microsoft.com>
Co-authored-by: Jan Vorlicek <janvorli@microsoft.com>
src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/InfoHdr.cs

index dc2ff48..4bb9478 100644 (file)
@@ -276,7 +276,8 @@ namespace ILCompiler.Reflection.ReadyToRun.x86
                                 break;
 
                             case (byte)InfoHdrAdjust.NEXT_OPCODE:
-                                encoding = (byte)(image[offset++] & (int)InfoHdrAdjustConstants.ADJ_ENCODING_MAX);
+                                nextByte = image[offset++];
+                                encoding = (byte)(nextByte & (int)InfoHdrAdjustConstants.ADJ_ENCODING_MAX);
                                 // encoding here always corresponds to codes in InfoHdrAdjust2 set
 
                                 if (encoding < (int)InfoHdrAdjustConstants.SET_RET_KIND_MAX)