summaryrefslogtreecommitdiff
path: root/src/vm
diff options
context:
space:
mode:
authorEvgeny Pavlov <e.pavlov@samsung.com>2016-07-20 10:28:08 +0300
committerEvgeny Pavlov <e.pavlov@samsung.com>2016-07-22 10:57:30 +0300
commitc8f12d042180cb21a6c401ff7611d8e5295ffa22 (patch)
tree690cf41deccbe762ea89cfa4f7a2ce4cc4843890 /src/vm
parent2f99c8cecaee900c274a5b2b77324874b0056bce (diff)
downloadcoreclr-c8f12d042180cb21a6c401ff7611d8e5295ffa22.tar.gz
coreclr-c8f12d042180cb21a6c401ff7611d8e5295ffa22.tar.bz2
coreclr-c8f12d042180cb21a6c401ff7611d8e5295ffa22.zip
Change 'Extract' -> 'GetValue' to prevent memory leaks
Diffstat (limited to 'src/vm')
-rw-r--r--src/vm/gdbjit.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vm/gdbjit.cpp b/src/vm/gdbjit.cpp
index c02d5f855c..13b040a9a5 100644
--- a/src/vm/gdbjit.cpp
+++ b/src/vm/gdbjit.cpp
@@ -346,7 +346,7 @@ void NotifyGdb::MethodCompiled(MethodDesc* MethodDescPtr)
/* Patch section offsets & sizes */
long offset = sizeof(Elf_Ehdr);
- Elf_Shdr* pShdr = reinterpret_cast<Elf_Shdr*>(sectHeaders.MemPtr.Extract());
+ Elf_Shdr* pShdr = reinterpret_cast<Elf_Shdr*>(sectHeaders.MemPtr.GetValue());
++pShdr; // .text
pShdr->sh_addr = pCode;
pShdr->sh_size = codeSize;
@@ -384,7 +384,7 @@ void NotifyGdb::MethodCompiled(MethodDesc* MethodDescPtr)
{
return;
}
- Elf_Ehdr* header = reinterpret_cast<Elf_Ehdr*>(elfHeader.MemPtr.Extract());
+ Elf_Ehdr* header = reinterpret_cast<Elf_Ehdr*>(elfHeader.MemPtr.GetValue());
#ifdef _TARGET_ARM_
header->e_flags = EF_ARM_EABI_VER5;
#ifdef ARM_SOFTFP
@@ -516,7 +516,7 @@ bool NotifyGdb::BuildLineTable(MemBuf& buf, PCODE startAddr, SymbolsInfo* lines,
}
/* Fill the line info header */
- DwarfLineNumHeader* header = reinterpret_cast<DwarfLineNumHeader*>(buf.MemPtr.Extract());
+ DwarfLineNumHeader* header = reinterpret_cast<DwarfLineNumHeader*>(buf.MemPtr.GetValue());
memcpy(buf.MemPtr, &LineNumHeader, sizeof(DwarfLineNumHeader));
header->m_length = buf.MemSize - sizeof(uint32_t);
header->m_hdr_length = sizeof(DwarfLineNumHeader) + 1 + fileTable.MemSize - 2 * sizeof(uint32_t) - sizeof(uint16_t);
@@ -535,7 +535,7 @@ bool NotifyGdb::BuildFileTable(MemBuf& buf, SymbolsInfo* lines, unsigned nlines)
const char** files = nullptr;
unsigned nfiles = 0;
- /* Extract file names and replace them with indices in file table */
+ /* GetValue file names and replace them with indices in file table */
files = new (nothrow) const char*[nlines];
if (files == nullptr)
return false;
@@ -753,7 +753,7 @@ bool NotifyGdb::BuildDebugInfo(MemBuf& buf)
return false;
/* Compile uint header */
- DwarfCompUnit* cu = reinterpret_cast<DwarfCompUnit*>(buf.MemPtr.Extract());
+ DwarfCompUnit* cu = reinterpret_cast<DwarfCompUnit*>(buf.MemPtr.GetValue());
cu->m_length = buf.MemSize - sizeof(uint32_t);
cu->m_version = 4;
cu->m_abbrev_offset = 0;
@@ -783,7 +783,7 @@ bool NotifyGdb::BuildDebugPub(MemBuf& buf, const char* name, uint32_t size, uint
if (buf.MemPtr == nullptr)
return false;
- DwarfPubHeader* header = reinterpret_cast<DwarfPubHeader*>(buf.MemPtr.Extract());
+ DwarfPubHeader* header = reinterpret_cast<DwarfPubHeader*>(buf.MemPtr.GetValue());
header->m_length = length - sizeof(uint32_t);
header->m_version = 2;
header->m_debug_info_off = 0;