Fix incorrect index for localsDebug array (#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)
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;
     }