From f6b3d9c49da8ae4506c016d0e7ce5161120beb7d Mon Sep 17 00:00:00 2001 From: Andrew Au Date: Sun, 5 Jan 2020 15:14:17 -0800 Subject: [PATCH] Make sure we update nextByte when we decode NEXT_OPCODE in x86 GCinfo (#1299) * 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 Co-authored-by: Jan Vorlicek --- .../tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/InfoHdr.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/InfoHdr.cs b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/InfoHdr.cs index dc2ff48..4bb9478 100644 --- a/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/InfoHdr.cs +++ b/src/coreclr/src/tools/crossgen2/ILCompiler.Reflection.ReadyToRun/x86/InfoHdr.cs @@ -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) -- 2.7.4