summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSlava Barinov <v.barinov@samsung.com>2019-07-01 13:51:11 (GMT)
committerSlava Barinov <v.barinov@samsung.com>2019-07-01 13:51:11 (GMT)
commit87725c16219e182168bc81d0ac6b304daf9d4576 (patch)
tree07dcd5b705d49f3a5f9143d4b999d7a6b580f4d6
parent89da0eebdf192340ff16a0291ccc2736f350d21f (diff)
downloadcoreclr-sandbox/vbarinov/asan.zip
coreclr-sandbox/vbarinov/asan.tar.gz
coreclr-sandbox/vbarinov/asan.tar.bz2
Enable sanitizer foreversandbox/vbarinov/asan
-rw-r--r--src/binder/assembly.cpp8
-rw-r--r--src/dlls/mscoree/unixinterface.cpp4
-rw-r--r--src/gc/unix/gcenv.unix.cpp22
-rw-r--r--src/pal/src/cruntime/malloc.cpp10
-rw-r--r--src/pal/src/cruntime/string.cpp6
-rw-r--r--src/pal/src/exception/machexception.cpp8
-rw-r--r--src/pal/src/exception/remote-unwind.cpp4
-rw-r--r--src/pal/src/file/file.cpp12
-rw-r--r--src/pal/src/include/pal/malloc.hpp4
-rw-r--r--src/pal/src/include/pal/synchcache.hpp8
-rw-r--r--src/pal/src/init/pal.cpp10
-rw-r--r--src/pal/src/loader/module.cpp30
-rw-r--r--src/pal/src/map/map.cpp4
-rw-r--r--src/pal/src/memory/heap.cpp12
-rw-r--r--src/pal/src/misc/cgroup.cpp8
-rw-r--r--src/pal/src/misc/environ.cpp4
-rw-r--r--src/pal/src/misc/sysinfo.cpp2
-rw-r--r--src/pal/src/thread/process.cpp2
-rw-r--r--src/pal/src/thread/thread.cpp92
-rw-r--r--src/vm/peimage.cpp6
20 files changed, 130 insertions, 126 deletions
diff --git a/src/binder/assembly.cpp b/src/binder/assembly.cpp
index 78a377c..c1c2b5e 100644
--- a/src/binder/assembly.cpp
+++ b/src/binder/assembly.cpp
@@ -69,7 +69,7 @@ namespace BINDER_SPACE
Exit:
SAFE_DELETE_ARRAY(pAssemblyRefTokens);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return hr;
}
};
@@ -115,7 +115,7 @@ Exit:
delete this;
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return ulRef;
}
@@ -154,7 +154,7 @@ Exit:
SAFE_RELEASE(m_pAssemblyName);
SAFE_RELEASE(m_pMDImport);
SAFE_DELETE_ARRAY(m_pAssemblyRefTokens);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
HRESULT Assembly::Init(
@@ -205,7 +205,7 @@ Exit:
}
Exit:
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
BINDER_LOG_LEAVE_HR(L"Assembly::Init", hr);
return hr;
}
diff --git a/src/dlls/mscoree/unixinterface.cpp b/src/dlls/mscoree/unixinterface.cpp
index cf9bbc5..407e51e 100644
--- a/src/dlls/mscoree/unixinterface.cpp
+++ b/src/dlls/mscoree/unixinterface.cpp
@@ -19,6 +19,9 @@
#include "../../vm/gdbjithelpers.h"
#endif // FEATURE_GDBJIT
+extern "C" void __sanitizer_enable_calls_forwarding() __attribute__((weak));
+extern "C" void __sanitizer_disable_calls_forwarding() __attribute__((weak));
+
typedef int (STDMETHODCALLTYPE *HostMain)(
const int argc,
const wchar_t** argv
@@ -171,6 +174,7 @@ int coreclr_initialize(
unsigned int* domainId)
{
HRESULT hr;
+ __sanitizer_disable_calls_forwarding();
#ifdef FEATURE_PAL
DWORD error = PAL_InitializeCoreCLR(exePath);
hr = HRESULT_FROM_WIN32(error);
diff --git a/src/gc/unix/gcenv.unix.cpp b/src/gc/unix/gcenv.unix.cpp
index ddbb00d..b78f316 100644
--- a/src/gc/unix/gcenv.unix.cpp
+++ b/src/gc/unix/gcenv.unix.cpp
@@ -121,7 +121,7 @@ bool GCToOSInterface::Initialize()
#endif // HAVE_MACH_ABSOLUTE_TIME
InitializeCGroup();
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return true;
}
@@ -138,7 +138,7 @@ void GCToOSInterface::Shutdown()
CleanupCGroup();
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
// Get numeric id of the current thread if possible on the
@@ -307,7 +307,7 @@ void* GCToOSInterface::VirtualReserve(size_t size, size_t alignment, uint32_t fl
pRetVal = pAlignedRetVal;
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return pRetVal;
}
@@ -321,7 +321,7 @@ bool GCToOSInterface::VirtualRelease(void* address, size_t size)
{
__sanitizer_disable_calls_forwarding();
int ret = munmap(address, size);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return (ret == 0);
}
@@ -337,7 +337,7 @@ bool GCToOSInterface::VirtualCommit(void* address, size_t size, uint32_t node)
assert(node == NUMA_NODE_UNDEFINED && "Numa allocation is not ported to local GC on unix yet");
__sanitizer_disable_calls_forwarding();
int result = mprotect(address, size, PROT_WRITE | PROT_READ);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return result == 0;
}
@@ -356,7 +356,7 @@ bool GCToOSInterface::VirtualDecommit(void* address, size_t size)
// be zeroed-out.
__sanitizer_disable_calls_forwarding();
void* result = mmap(address, size, PROT_NONE, MAP_FIXED | MAP_ANON | MAP_PRIVATE, -1, 0);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return result != NULL;
}
@@ -384,7 +384,7 @@ bool GCToOSInterface::VirtualReset(void * address, size_t size, bool unlock)
st = madvise(address, size, MADV_DONTNEED);
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return (st == 0);
}
@@ -745,7 +745,7 @@ void CLRCriticalSection::Initialize()
{
__sanitizer_disable_calls_forwarding();
int st = pthread_mutex_init(&m_cs.mutex, NULL);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
assert(st == 0);
}
@@ -754,7 +754,7 @@ void CLRCriticalSection::Destroy()
{
__sanitizer_disable_calls_forwarding();
int st = pthread_mutex_destroy(&m_cs.mutex);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
assert(st == 0);
}
@@ -763,7 +763,7 @@ void CLRCriticalSection::Enter()
{
__sanitizer_disable_calls_forwarding();
pthread_mutex_lock(&m_cs.mutex);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
// Leave the critical section
@@ -771,5 +771,5 @@ void CLRCriticalSection::Leave()
{
__sanitizer_disable_calls_forwarding();
pthread_mutex_unlock(&m_cs.mutex);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
diff --git a/src/pal/src/cruntime/malloc.cpp b/src/pal/src/cruntime/malloc.cpp
index 8e7167f..b2b0978 100644
--- a/src/pal/src/cruntime/malloc.cpp
+++ b/src/pal/src/cruntime/malloc.cpp
@@ -59,7 +59,7 @@ CorUnix::InternalRealloc(
{
__sanitizer_disable_calls_forwarding();
free(pvMemblock);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
pvMem = NULL;
}
@@ -67,7 +67,7 @@ CorUnix::InternalRealloc(
{
__sanitizer_disable_calls_forwarding();
pvMem = realloc(pvMemblock, szSize);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
LOGEXIT("realloc returns void * %p\n", pvMem);
@@ -83,7 +83,7 @@ PAL_free(
{
__sanitizer_disable_calls_forwarding();
free(pvMem);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
void *
@@ -110,7 +110,7 @@ CorUnix::InternalMalloc(
__sanitizer_disable_calls_forwarding();
pvMem = (void*)malloc(szSize);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return pvMem;
}
@@ -123,6 +123,6 @@ PAL__strdup(
{
__sanitizer_disable_calls_forwarding();
char* result = strdup(c_szStr);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return result;
}
diff --git a/src/pal/src/cruntime/string.cpp b/src/pal/src/cruntime/string.cpp
index 2b3acaa..33cb547 100644
--- a/src/pal/src/cruntime/string.cpp
+++ b/src/pal/src/cruntime/string.cpp
@@ -59,7 +59,7 @@ _strnicmp( const char *s1, const char *s2, size_t count )
PERF_ENTRY(_strnicmp);
ENTRY("_strnicmp (s1=%p (%s), s2=%p (%s), count=%d)\n", s1?s1:"NULL", s1?s1:"NULL", s2?s2:"NULL", s2?s2:"NULL", count);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
ret = strncasecmp(s1, s2, count );
__sanitizer_disable_calls_forwarding();
@@ -99,7 +99,7 @@ _stricmp(
PERF_ENTRY(_stricmp);
ENTRY("_stricmp (s1=%p (%s), s2=%p (%s))\n", s1?s1:"NULL", s1?s1:"NULL", s2?s2:"NULL", s2?s2:"NULL");
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
ret = strcasecmp(s1, s2);
__sanitizer_disable_calls_forwarding();
@@ -143,7 +143,7 @@ _strlwr(
PERF_ENTRY(_strlwr);
ENTRY("_strlwr (str=%p (%s))\n", str?str:"NULL", str?str:"NULL");
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
while (*str)
{
*str = tolower(*str);
diff --git a/src/pal/src/exception/machexception.cpp b/src/pal/src/exception/machexception.cpp
index 1af685e..17ef21b 100644
--- a/src/pal/src/exception/machexception.cpp
+++ b/src/pal/src/exception/machexception.cpp
@@ -114,7 +114,7 @@ public:
{
m_previous->m_next = Current->m_next;
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
free(Current);
__sanitizer_disable_calls_forwarding();
@@ -179,7 +179,7 @@ GetExceptionMask()
if (exceptionSettings)
{
exMode = (MachExceptionMode)atoi(exceptionSettings);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
free(exceptionSettings);
__sanitizer_disable_calls_forwarding();
}
@@ -1227,7 +1227,7 @@ SEHExceptionThread(void *args)
pExceptionInfo->RestoreState(thread);
// Allocate an forwarded exception entry
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
ForwardedException *pfe = (ForwardedException *)malloc(sizeof(ForwardedException));
__sanitizer_disable_calls_forwarding();
if (pfe == NULL)
@@ -1398,7 +1398,7 @@ SEHInitializeMachExceptions(DWORD flags)
}
// Create the thread that will listen to the exception for all threads
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
int createret = pthread_create(&exception_thread, NULL, SEHExceptionThread, NULL);
__sanitizer_disable_calls_forwarding();
if (createret != 0)
diff --git a/src/pal/src/exception/remote-unwind.cpp b/src/pal/src/exception/remote-unwind.cpp
index b2a564c..574643a 100644
--- a/src/pal/src/exception/remote-unwind.cpp
+++ b/src/pal/src/exception/remote-unwind.cpp
@@ -731,7 +731,7 @@ ExtractProcInfoFromFde(const libunwindInfo* info, unw_word_t* addrp, unw_proc_in
// Now fill out the proc info if requested
if (need_unwind_info)
{
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (dci.have_abi_marker)
{
if (!ReadValue16(info, &addr, &dci.abi)) {
@@ -1002,7 +1002,7 @@ static void
put_unwind_info(unw_addr_space_t as, unw_proc_info_t *pip, void *arg)
{
if (pip->unwind_info != nullptr) {
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
free(pip->unwind_info);
__sanitizer_disable_calls_forwarding();
pip->unwind_info = nullptr;
diff --git a/src/pal/src/file/file.cpp b/src/pal/src/file/file.cpp
index 1ed579a..144928c 100644
--- a/src/pal/src/file/file.cpp
+++ b/src/pal/src/file/file.cpp
@@ -267,7 +267,7 @@ CorUnix::RealPathHelper(LPCSTR lpUnixPath, PathCharString& lpBuffer)
StringHolder lpRealPath;
__sanitizer_disable_calls_forwarding();
lpRealPath = realpath(lpUnixPath, NULL);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (lpRealPath.IsNull())
{
return FALSE;
@@ -454,7 +454,7 @@ LExit:
// convert all these into ERROR_PATH_NOT_FOUND
palError = ERROR_PATH_NOT_FOUND;
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return palError;
}
@@ -727,7 +727,7 @@ CorUnix::InternalCreateFile(
_ASSERTE(pLocalData->unix_filename == NULL);
__sanitizer_disable_calls_forwarding();
pLocalData->unix_filename = PAL__strdup(lpUnixPath);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (pLocalData->unix_filename == NULL)
{
ASSERT("Unable to copy string\n");
@@ -806,7 +806,7 @@ done:
palError = ERROR_ALREADY_EXISTS;
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return palError;
}
@@ -3492,7 +3492,7 @@ CopyFileA(
/* Need to preserve the owner/group and chmod() flags */
__sanitizer_disable_calls_forwarding();
lpUnixPath = PAL__strdup(lpExistingFileName);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if ( lpUnixPath == NULL )
{
ERROR("PAL__strdup() failed\n");
@@ -3523,7 +3523,7 @@ CopyFileA(
__sanitizer_disable_calls_forwarding();
PAL_free(lpUnixPath);
lpUnixPath = PAL__strdup(lpNewFileName);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if ( lpUnixPath == NULL )
{
ERROR("PAL__strdup() failed\n");
diff --git a/src/pal/src/include/pal/malloc.hpp b/src/pal/src/include/pal/malloc.hpp
index e72b538..6a9880e 100644
--- a/src/pal/src/include/pal/malloc.hpp
+++ b/src/pal/src/include/pal/malloc.hpp
@@ -145,7 +145,7 @@ namespace CorUnix{
{
if (p)
{
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
p->~T();
free(p);
__sanitizer_disable_calls_forwarding();
@@ -158,7 +158,7 @@ namespace CorUnix{
{
size_t *pRealMem = (size_t*)p - 1;
size_t cElements = *pRealMem;
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
for (size_t i = 0; i < cElements; i++)
p[i].~T();
free(pRealMem);
diff --git a/src/pal/src/include/pal/synchcache.hpp b/src/pal/src/include/pal/synchcache.hpp
index 41e02b1..47dfe3e 100644
--- a/src/pal/src/include/pal/synchcache.hpp
+++ b/src/pal/src/include/pal/synchcache.hpp
@@ -293,7 +293,7 @@ namespace CorUnix
{
__sanitizer_disable_calls_forwarding();
shridObj = malloc(sizeof(USHRSynchCacheStackNode));
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (NULL == shridObj)
{
Flush(pthrCurrent, true);
@@ -316,7 +316,7 @@ namespace CorUnix
{
__sanitizer_disable_calls_forwarding();
shridObj = malloc(sizeof(USHRSynchCacheStackNode));
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (NULL == shridObj)
break;
#ifdef _DEBUG
@@ -366,7 +366,7 @@ namespace CorUnix
{
__sanitizer_disable_calls_forwarding();
free(shridObj);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
Unlock(pthrCurrent);
}
@@ -395,7 +395,7 @@ namespace CorUnix
shridTemp = pTemp->pointers.shrid;
__sanitizer_disable_calls_forwarding();
free(shridTemp);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
}
};
diff --git a/src/pal/src/init/pal.cpp b/src/pal/src/init/pal.cpp
index 6017379..8eb654d 100644
--- a/src/pal/src/init/pal.cpp
+++ b/src/pal/src/init/pal.cpp
@@ -1258,7 +1258,7 @@ static LPWSTR INIT_FormatCommandLine (int argc, const char * const *argv)
if (i == 0)
{
ASSERT("MultiByteToWideChar failure\n");
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
free(command_line);
__sanitizer_disable_calls_forwarding();
return NULL;
@@ -1268,7 +1268,7 @@ static LPWSTR INIT_FormatCommandLine (int argc, const char * const *argv)
if(retval == NULL)
{
ERROR("can't allocate memory for Unicode command line!\n");
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
free(command_line);
__sanitizer_disable_calls_forwarding();
return NULL;
@@ -1277,7 +1277,7 @@ static LPWSTR INIT_FormatCommandLine (int argc, const char * const *argv)
if(!MultiByteToWideChar(CP_ACP, 0,command_line, i, retval, i))
{
ASSERT("MultiByteToWideChar failure\n");
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
free(retval);
__sanitizer_disable_calls_forwarding();
retval = NULL;
@@ -1285,7 +1285,7 @@ static LPWSTR INIT_FormatCommandLine (int argc, const char * const *argv)
else
TRACE("Command line is %s\n", command_line);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
free(command_line);
__sanitizer_disable_calls_forwarding();
return retval;
@@ -1352,7 +1352,7 @@ static LPWSTR INIT_ConvertEXEPath(LPCSTR exe_path)
return_value, return_size))
{
ASSERT("MultiByteToWideChar failure\n");
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
free(return_value);
__sanitizer_disable_calls_forwarding();
return_value = NULL;
diff --git a/src/pal/src/loader/module.cpp b/src/pal/src/loader/module.cpp
index 85010a2..7f02996 100644
--- a/src/pal/src/loader/module.cpp
+++ b/src/pal/src/loader/module.cpp
@@ -191,7 +191,7 @@ LoadLibraryExA(
{
__sanitizer_disable_calls_forwarding();
PAL_free(lpstr);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
LOGEXIT("LoadLibraryExA returns HMODULE %p\n", hModule);
@@ -334,7 +334,7 @@ GetProcAddress(
__sanitizer_disable_calls_forwarding();
ProcAddress = (FARPROC) dlsym(module->dl_handle, lpPALProcName);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
symbolName = lpPALProcName;
}
@@ -344,7 +344,7 @@ GetProcAddress(
{
__sanitizer_disable_calls_forwarding();
ProcAddress = (FARPROC) dlsym(module->dl_handle, lpProcName);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
if (ProcAddress)
@@ -743,7 +743,7 @@ PAL_GetProcAddressDirect(
__sanitizer_disable_calls_forwarding();
address = (FARPROC) dlsym(dl_handle, lpProcName);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
LOGEXIT("PAL_GetProcAddressDirect returns FARPROC %p\n", address);
PERF_EXIT(PAL_GetProcAddressDirect);
@@ -846,7 +846,7 @@ PAL_LOADLoadPEFile(HANDLE hFile)
__sanitizer_disable_calls_forwarding();
PAL_free(envVar);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
}
#endif // _DEBUG
@@ -990,7 +990,7 @@ BOOL LOADInitializeModules()
exe_module.self = (HMODULE)&exe_module;
__sanitizer_disable_calls_forwarding();
exe_module.dl_handle = dlopen(nullptr, RTLD_LAZY);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (exe_module.dl_handle == nullptr)
{
ERROR("Executable module will be broken : dlopen(nullptr) failed\n");
@@ -1033,7 +1033,7 @@ BOOL LOADSetExeName(LPWSTR name)
// Save the exe path in the exe module struct
__sanitizer_disable_calls_forwarding();
PAL_free(exe_module.lib_name);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
exe_module.lib_name = name;
// For platforms where we can't trust the handle to be constant, we need to
@@ -1066,7 +1066,7 @@ exit:
{
__sanitizer_disable_calls_forwarding();
PAL_free(pszExeName);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
#endif
UnlockModuleList();
@@ -1225,7 +1225,7 @@ static BOOL LOADFreeLibrary(MODSTRUCT *module, BOOL fCallDllMain)
{
__sanitizer_disable_calls_forwarding();
PUNREGISTER_MODULE unregisterModule = (PUNREGISTER_MODULE)dlsym(module->dl_handle, "PAL_UnregisterModule");
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (unregisterModule != nullptr)
{
unregisterModule(module->hinstance);
@@ -1243,7 +1243,7 @@ static BOOL LOADFreeLibrary(MODSTRUCT *module, BOOL fCallDllMain)
/* release all memory */
PAL_free(module->lib_name);
PAL_free(module);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
retval = TRUE;
@@ -1506,7 +1506,7 @@ static NATIVE_LIBRARY_HANDLE LOADLoadLibraryDirect(LPCSTR libraryNameOrPath)
__sanitizer_disable_calls_forwarding();
NATIVE_LIBRARY_HANDLE dl_handle = dlopen(libraryNameOrPath, RTLD_LAZY);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (dl_handle == nullptr)
{
SetLastError(ERROR_MOD_NOT_FOUND);
@@ -1557,7 +1557,7 @@ static MODSTRUCT *LOADAllocModule(NATIVE_LIBRARY_HANDLE dl_handle, LPCSTR name)
ERROR("couldn't convert name to a wide-character string\n");
__sanitizer_disable_calls_forwarding();
PAL_free(module);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return nullptr;
}
@@ -1642,7 +1642,7 @@ static MODSTRUCT *LOADAddModule(NATIVE_LIBRARY_HANDLE dl_handle, LPCSTR libraryN
/* We now get the address of DllMain if the module contains one. */
__sanitizer_disable_calls_forwarding();
module->pDllMain = (PDLLMAIN)dlsym(module->dl_handle, "DllMain");
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
/* Add the new module on to the end of the list */
module->prev = exe_module.prev;
@@ -1691,7 +1691,7 @@ static HMODULE LOADRegisterLibraryDirect(NATIVE_LIBRARY_HANDLE dl_handle, LPCSTR
{
__sanitizer_disable_calls_forwarding();
PREGISTER_MODULE registerModule = (PREGISTER_MODULE)dlsym(module->dl_handle, "PAL_RegisterModule");
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (registerModule != nullptr)
{
module->hinstance = registerModule(libraryNameOrPath);
@@ -1783,7 +1783,7 @@ BOOL LOADInitializeCoreCLRModule()
__sanitizer_disable_calls_forwarding();
PDLLMAIN pRuntimeDllMain = (PDLLMAIN)dlsym(module->dl_handle, "CoreDllMain");
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (!pRuntimeDllMain)
{
ERROR("Can not find the CoreDllMain entry point\n");
diff --git a/src/pal/src/map/map.cpp b/src/pal/src/map/map.cpp
index 679d49e..92edd30 100644
--- a/src/pal/src/map/map.cpp
+++ b/src/pal/src/map/map.cpp
@@ -639,7 +639,7 @@ CorUnix::InternalCreateFileMapping(
}
_ASSERTE(pImmutableData->lpFileName == NULL);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
pImmutableData->lpFileName = strdup(pFileLocalData->unix_filename);
__sanitizer_disable_calls_forwarding();
if (pImmutableData->lpFileName == NULL)
@@ -2652,7 +2652,7 @@ BOOL MAPUnmapPEFile(LPCVOID lpAddress)
{
pFileObject->ReleaseReference(pThread);
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
free(pView); // this leaves pLink dangling
__sanitizer_disable_calls_forwarding();
}
diff --git a/src/pal/src/memory/heap.cpp b/src/pal/src/memory/heap.cpp
index 328e693..abd06b1 100644
--- a/src/pal/src/memory/heap.cpp
+++ b/src/pal/src/memory/heap.cpp
@@ -57,7 +57,7 @@ RtlMoveMemory(
__sanitizer_disable_calls_forwarding();
memmove(Destination, Source, Length);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
LOGEXIT("RtlMoveMemory returning\n");
PERF_EXIT(RtlMoveMemory);
@@ -106,7 +106,7 @@ HeapCreate(
ret = (HANDLE)DUMMY_HEAP;
#endif // __APPLE__
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
LOGEXIT("HeapCreate returning HANDLE %p\n", ret);
PERF_EXIT(HeapCreate);
return ret;
@@ -141,7 +141,7 @@ GetProcessHeap(
ret = (HANDLE) DUMMY_HEAP;
#endif
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
LOGEXIT("GetProcessHeap returning HANDLE %p\n", ret);
PERF_EXIT(GetProcessHeap);
return ret;
@@ -216,7 +216,7 @@ HeapAlloc(
memset(pMem, 0, numberOfBytes);
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
LOGEXIT("HeapAlloc returning LPVOID %p\n", pMem);
PERF_EXIT(HeapAlloc);
return (pMem);
@@ -280,7 +280,7 @@ HeapFree(
#endif // __APPLE__ else
done:
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
LOGEXIT( "HeapFree returning BOOL %d\n", bRetVal );
PERF_EXIT(HeapFree);
return bRetVal;
@@ -361,7 +361,7 @@ HeapReAlloc(
}
done:
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
LOGEXIT("HeapReAlloc returns LPVOID %p\n", pMem);
PERF_EXIT(HeapReAlloc);
return pMem;
diff --git a/src/pal/src/misc/cgroup.cpp b/src/pal/src/misc/cgroup.cpp
index 4640f81..15bf949 100644
--- a/src/pal/src/misc/cgroup.cpp
+++ b/src/pal/src/misc/cgroup.cpp
@@ -162,7 +162,7 @@ private:
PAL_free(hierarchy_mount);
PAL_free(hierarchy_root);
PAL_free(cgroup_path_relative_to_mount);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return cgroup_path;
}
@@ -247,7 +247,7 @@ private:
PAL_free(line);
if (mountinfofile)
fclose(mountinfofile);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
static char* FindCGroupPathForSubsystem(bool (*is_subsystem)(const char *))
@@ -312,7 +312,7 @@ private:
PAL_free(line);
if (cgroupfile)
fclose(cgroupfile);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return cgroup_path;
}
@@ -374,7 +374,7 @@ private:
if (file)
fclose(file);
PAL_free(line);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return result;
}
};
diff --git a/src/pal/src/misc/environ.cpp b/src/pal/src/misc/environ.cpp
index 7e65bba..801217e 100644
--- a/src/pal/src/misc/environ.cpp
+++ b/src/pal/src/misc/environ.cpp
@@ -702,7 +702,7 @@ BOOL ResizeEnvironment(int newSize)
if (newSize >= palEnvironmentCount)
{
// If palEnvironment is null, realloc acts like malloc.
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
char **newEnvironment = (char**)realloc(palEnvironment, newSize * sizeof(char *));
__sanitizer_disable_calls_forwarding();
if (newEnvironment != nullptr)
@@ -806,7 +806,7 @@ BOOL EnvironPutenv(const char* entry, BOOL deleteIfEmpty)
return FALSE;
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
char* copy = strdup(entry);
__sanitizer_disable_calls_forwarding();
if (copy == nullptr)
diff --git a/src/pal/src/misc/sysinfo.cpp b/src/pal/src/misc/sysinfo.cpp
index 0a416a4..e3dae21 100644
--- a/src/pal/src/misc/sysinfo.cpp
+++ b/src/pal/src/misc/sysinfo.cpp
@@ -402,7 +402,7 @@ ReadMemoryValueFromFile(const char* filename, size_t* val)
char* endptr = nullptr;
size_t num = 0, l, multiplier;
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (val == nullptr)
return false;
diff --git a/src/pal/src/thread/process.cpp b/src/pal/src/thread/process.cpp
index 6417d55..c42ac0a 100644
--- a/src/pal/src/thread/process.cpp
+++ b/src/pal/src/thread/process.cpp
@@ -2166,7 +2166,7 @@ void CreateSemaphoreName(char semName[CLR_SEM_MAX_NAMELEN], LPCSTR semaphoreName
BOOL
GetProcessIdDisambiguationKey(DWORD processId, UINT64 *disambiguationKey)
{
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (disambiguationKey == nullptr)
{
_ASSERTE(!"disambiguationKey argument cannot be null!");
diff --git a/src/pal/src/thread/thread.cpp b/src/pal/src/thread/thread.cpp
index 37f4a81..711ed6f 100644
--- a/src/pal/src/thread/thread.cpp
+++ b/src/pal/src/thread/thread.cpp
@@ -187,7 +187,7 @@ static void InternalEndCurrentThreadWrapper(void *arg)
// in InternalEndCurrentThread.
InternalEndCurrentThread(pThread);
pthread_setspecific(thObjKey, NULL);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
/*++
@@ -203,12 +203,12 @@ BOOL TLSInitialize()
__sanitizer_disable_calls_forwarding();
if (pthread_key_create(&thObjKey, InternalEndCurrentThreadWrapper))
{
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
ERROR("Couldn't create the thread object key\n");
return FALSE;
}
SPINLOCKInit(&free_threads_spinlock);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return TRUE;
}
@@ -225,7 +225,7 @@ VOID TLSCleanup()
SPINLOCKDestroy(&free_threads_spinlock);
pthread_key_delete(thObjKey);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
/*++
@@ -264,7 +264,7 @@ CPalThread* AllocTHREAD()
pThread = new (pThread) CPalThread;
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return pThread;
}
@@ -323,7 +323,7 @@ static void FreeTHREAD(CPalThread *pThread)
/* Release the lock */
SPINLOCKRelease(&free_threads_spinlock);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
@@ -379,7 +379,7 @@ THREADGetThreadProcessId(
ERROR("Couldn't retreive the hThread:%p pid owner !\n", hThread);
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return dwProcessId;
}
@@ -408,7 +408,7 @@ GetCurrentThreadId(
dwThreadId = (DWORD)THREADSilentGetCurrentThreadId();
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
LOGEXIT("GetCurrentThreadId returns DWORD %#x\n", dwThreadId);
PERF_EXIT(GetCurrentThreadId);
@@ -860,7 +860,7 @@ EXIT:
_ASSERT_MSG(!fHoldingProcessLock, "Exiting InternalCreateThread while still holding the process critical section.\n");
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return palError;
}
@@ -897,7 +897,7 @@ ExitThread(
/* kill the thread (itself), resulting in a call to InternalEndCurrentThread */
__sanitizer_disable_calls_forwarding();
pthread_exit(NULL);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
ASSERT("pthread_exit should not return!\n");
for (;;);
@@ -1221,10 +1221,10 @@ CorUnix::InternalSetThreadPriority(
{
ASSERT("Unable to get current thread scheduling information\n");
palError = ERROR_INTERNAL_ERROR;
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
goto InternalSetThreadPriorityExit;
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
#if !HAVE_SCHED_OTHER_ASSIGNABLE
@@ -1294,7 +1294,7 @@ CorUnix::InternalSetThreadPriority(
/* Finally, set the new priority into place */
__sanitizer_disable_calls_forwarding();
st = pthread_setschedparam(pTargetThread->GetPThreadSelf(), policy, &schedParam);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (st != 0)
{
#if SET_SCHEDPARAM_NEEDS_PRIVS
@@ -1370,7 +1370,7 @@ CorUnix::GetThreadTimesInternal(
mach_port_t mhThread;
__sanitizer_anable_calls_forwarding();
mhThread = pthread_mach_thread_np(pthrTarget->GetPThreadSelf());
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
kern_return_t status;
status = thread_info(
@@ -1522,13 +1522,13 @@ CorUnix::GetThreadTimesInternal(
if (pthread_getcpuclockid(pTargetThread->GetPThreadSelf(), &cid) != 0)
#endif
{
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
ASSERT("Unable to get clock from thread\n", hThread);
SetLastError(ERROR_INTERNAL_ERROR);
pTargetThread->Unlock(pThread);
goto SetTimesToZero;
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
struct timespec ts;
if (clock_gettime(cid, &ts) != 0)
@@ -1680,7 +1680,7 @@ CPalThread::ThreadEntry(
#if HAVE_MACH_THREADS
pThread->m_machPortSelf = pthread_mach_thread_np(pThread->m_pthreadSelf);
#endif
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
#if HAVE_THREAD_SELF
pThread->m_dwLwpId = (DWORD) thread_self();
#elif HAVE__LWP_SELF
@@ -1991,7 +1991,7 @@ CreateThreadObjectExit:
pobjRegisteredThread->ReleaseReference(pThread);
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return palError;
}
@@ -2099,7 +2099,7 @@ InternalCreateDummyThreadExit:
pDummyThread->ReleaseThreadReference();
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return palError;
}
@@ -2161,7 +2161,7 @@ CorUnix::InternalGetThreadDataFromHandle(
}
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return palError;
}
@@ -2190,13 +2190,13 @@ CPalThread::RunPreCreateInitializers(
__sanitizer_disable_calls_forwarding();
iError = pthread_cond_init(&m_startCond, NULL);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (0 != iError)
{
__sanitizer_disable_calls_forwarding();
pthread_mutex_destroy(&m_startMutex);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
goto RunPreCreateInitializersExit;
}
@@ -2245,7 +2245,7 @@ CPalThread::RunPreCreateInitializers(
RunPreCreateInitializersExit:
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return palError;
}
@@ -2277,7 +2277,7 @@ CPalThread::~CPalThread()
iError = pthread_mutex_destroy(&m_startMutex);
_ASSERTE(0 == iError);
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
void
@@ -2360,7 +2360,7 @@ CPalThread::RunPostCreateInitializers(
#endif // FEATURE_PAL_SXS
RunPostCreateInitializersExit:
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return palError;
}
@@ -2390,7 +2390,7 @@ CPalThread::SetStartStatus(
__sanitizer_disable_calls_forwarding();
iError = pthread_mutex_lock(&m_startMutex);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (0 != iError)
{
@@ -2403,7 +2403,7 @@ CPalThread::SetStartStatus(
__sanitizer_disable_calls_forwarding();
iError = pthread_cond_signal(&m_startCond);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (0 != iError)
{
ASSERT("pthread primitive failure\n");
@@ -2412,7 +2412,7 @@ CPalThread::SetStartStatus(
__sanitizer_disable_calls_forwarding();
iError = pthread_mutex_unlock(&m_startMutex);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (0 != iError)
{
ASSERT("pthread primitive failure\n");
@@ -2429,7 +2429,7 @@ CPalThread::WaitForStartStatus(
__sanitizer_disable_calls_forwarding();
iError = pthread_mutex_lock(&m_startMutex);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (0 != iError)
{
@@ -2441,7 +2441,7 @@ CPalThread::WaitForStartStatus(
{
__sanitizer_disable_calls_forwarding();
iError = pthread_cond_wait(&m_startCond, &m_startMutex);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (0 != iError)
{
@@ -2452,7 +2452,7 @@ CPalThread::WaitForStartStatus(
__sanitizer_disable_calls_forwarding();
iError = pthread_mutex_unlock(&m_startMutex);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (0 != iError)
{
@@ -2527,7 +2527,7 @@ CPalThread::EnsureSignalAlternateStack()
}
}
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return (st == 0);
}
@@ -2569,7 +2569,7 @@ CPalThread::FreeSignalAlternateStack()
}
}
}
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
#endif // !HAVE_MACH_EXCEPTIONS
@@ -2593,14 +2593,14 @@ IncrementEndingThreadCount(
__sanitizer_disable_calls_forwarding();
iError = pthread_mutex_lock(&ptmEndThread);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
_ASSERT_MSG(iError == 0, "pthread_mutex_lock returned %d\n", iError);
iEndingThreads++;
__sanitizer_disable_calls_forwarding();
iError = pthread_mutex_unlock(&ptmEndThread);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
_ASSERT_MSG(iError == 0, "pthread_mutex_unlock returned %d\n", iError);
}
@@ -2613,7 +2613,7 @@ DecrementEndingThreadCount(
__sanitizer_disable_calls_forwarding();
iError = pthread_mutex_lock(&ptmEndThread);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
_ASSERT_MSG(iError == 0, "pthread_mutex_lock returned %d\n", iError);
iEndingThreads--;
@@ -2623,13 +2623,13 @@ DecrementEndingThreadCount(
{
__sanitizer_disable_calls_forwarding();
iError = pthread_cond_signal(&ptcEndThread);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
_ASSERT_MSG(iError == 0, "pthread_cond_signal returned %d\n", iError);
}
__sanitizer_disable_calls_forwarding();
iError = pthread_mutex_unlock(&ptmEndThread);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
_ASSERT_MSG(iError == 0, "pthread_mutex_unlock returned %d\n", iError);
}
@@ -2642,20 +2642,20 @@ WaitForEndingThreads(
__sanitizer_disable_calls_forwarding();
iError = pthread_mutex_lock(&ptmEndThread);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
_ASSERT_MSG(iError == 0, "pthread_mutex_lock returned %d\n", iError);
while (iEndingThreads > 0)
{
__sanitizer_disable_calls_forwarding();
iError = pthread_cond_wait(&ptcEndThread, &ptmEndThread);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
_ASSERT_MSG(iError == 0, "pthread_cond_wait returned %d\n", iError);
}
__sanitizer_disable_calls_forwarding();
iError = pthread_mutex_unlock(&ptmEndThread);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
_ASSERT_MSG(iError == 0, "pthread_mutex_unlock returned %d\n", iError);
}
@@ -2669,7 +2669,7 @@ CorUnix::InitializeEndingThreadsData(
__sanitizer_disable_calls_forwarding();
iError = pthread_mutex_init(&ptmEndThread, NULL);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (0 != iError)
{
goto InitializeEndingThreadsDataExit;
@@ -2677,7 +2677,7 @@ CorUnix::InitializeEndingThreadsData(
__sanitizer_disable_calls_forwarding();
iError = pthread_cond_init(&ptcEndThread, NULL);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
if (0 != iError)
{
//
@@ -2687,7 +2687,7 @@ CorUnix::InitializeEndingThreadsData(
__sanitizer_disable_calls_forwarding();
pthread_mutex_destroy(&ptmEndThread);
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
goto InitializeEndingThreadsDataExit;
}
@@ -2795,7 +2795,7 @@ CPalThread::GetStackBase()
stackBase = (void*)((size_t)stackAddr + stackSize);
#endif
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return stackBase;
}
@@ -2835,7 +2835,7 @@ CPalThread::GetStackLimit()
status = pthread_attr_destroy(&attr);
_ASSERT_MSG(status == 0, "pthread_attr_destroy call failed");
#endif
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return stackLimit;
}
diff --git a/src/vm/peimage.cpp b/src/vm/peimage.cpp
index 7f8ce81..edb1e20 100644
--- a/src/vm/peimage.cpp
+++ b/src/vm/peimage.cpp
@@ -75,7 +75,7 @@ void PEImage::Startup()
#endif //FEATURE_USE_LCID
END_SO_INTOLERANT_CODE;
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
RETURN;
}
@@ -207,7 +207,7 @@ PEImage::~PEImage()
if (m_pMDTracker != NULL)
m_pMDTracker->Deactivate();
#endif // METADATATRACKER_ENABLED
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
}
/* static */
@@ -291,7 +291,7 @@ ULONG PEImage::Release()
if (result == 0)
delete this;
- __sanitizer_enable_calls_forwarding();
+ __sanitizer_disable_calls_forwarding();
return result;
}