Fix incorrect index for localsDebug array (dotnet/coreclr#7495)
authorEvgeny Pavlov <lucenticus@gmail.com>
Thu, 6 Oct 2016 14:30:42 +0000 (17:30 +0300)
committerJan Kotas <jkotas@microsoft.com>
Thu, 6 Oct 2016 14:30:42 +0000 (07:30 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/920bf1330d0148fc5a277d7ea18f4b7c95c89258

src/coreclr/src/vm/gdbjit.cpp

index 4debb30..0aa2fcc 100644 (file)
@@ -1423,7 +1423,7 @@ bool NotifyGdb::BuildDebugInfo(MemBuf& buf, NewArrayHolder<ArgsDebugInfo> &argsD
         bufVar[i].m_var_type = localsDebug[i-argsDebugSize].m_type_offset;
         memcpy(buf.MemPtr + offset, &bufVar[i], sizeof(DebugInfoVar));
         offset += sizeof(DebugInfoVar);
-        int len = GetFrameLocation(localsDebug[i].m_native_offset, bufVarLoc);
+        int len = GetFrameLocation(localsDebug[i-argsDebugSize].m_native_offset, bufVarLoc);
         memcpy(buf.MemPtr + offset, bufVarLoc, len);
         offset += len;
     }