diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/pal/src/memory/local.cpp | 47 | ||||
-rw-r--r-- | src/vm/ilmarshalers.cpp | 3 |
2 files changed, 47 insertions, 3 deletions
diff --git a/src/pal/src/memory/local.cpp b/src/pal/src/memory/local.cpp index 3a0f40f8c4..44d9feb0c5 100644 --- a/src/pal/src/memory/local.cpp +++ b/src/pal/src/memory/local.cpp @@ -26,6 +26,14 @@ Revision History: SET_DEFAULT_DEBUG_CHANNEL(MEM); +#ifdef TIZEN_ASAN_ENVIRONMENT +extern "C" { +extern void __sanitizer_disable_interceptors() __attribute__ ((weak)); +extern void __sanitizer_enable_interceptors() __attribute__ ((weak)); +extern bool __sanitizer_interceptors_are_enabled() __attribute__ ((weak)); +} +#endif + static int AllocFlagsToHeapAllocFlags (IN UINT AllocFlags, @@ -70,7 +78,24 @@ LocalAlloc( goto done; } - lpRetVal = HeapAlloc( GetProcessHeap(), uFlags, uBytes ); +#ifdef TIZEN_ASAN_ENVIRONMENT + if (__sanitizer_interceptors_are_enabled != NULL) + { + bool san_enabled; + san_enabled = __sanitizer_interceptors_are_enabled(); + if (!san_enabled) { + __sanitizer_enable_interceptors(); + } + lpRetVal = HeapAlloc( GetProcessHeap(), uFlags, uBytes ); + if (!san_enabled) { + __sanitizer_disable_interceptors(); + } + } + else +#endif + { + lpRetVal = HeapAlloc( GetProcessHeap(), uFlags, uBytes ); + } done: LOGEXIT( "LocalAlloc returning %p.\n", lpRetVal ); @@ -128,7 +153,25 @@ LocalFree( if ( hMem ) { - bRetVal = HeapFree( GetProcessHeap(), 0, hMem ); +#ifdef TIZEN_ASAN_ENVIRONMENT + if (__sanitizer_interceptors_are_enabled != NULL) + { + bool san_enabled; + san_enabled = __sanitizer_interceptors_are_enabled(); + if (!san_enabled) { + __sanitizer_enable_interceptors(); + } + bRetVal = HeapFree( GetProcessHeap(), 0, hMem ); + if (!san_enabled) { + __sanitizer_disable_interceptors(); + } + } + else +#endif + { + bRetVal = HeapFree( GetProcessHeap(), 0, hMem ); + } + } else { diff --git a/src/vm/ilmarshalers.cpp b/src/vm/ilmarshalers.cpp index a89aeaf2a1..9e7ee17484 100644 --- a/src/vm/ilmarshalers.cpp +++ b/src/vm/ilmarshalers.cpp @@ -3808,11 +3808,12 @@ void ILMngdMarshaler::EmitCallMngdMarshalerMethod(ILCodeStream* pslILEmit, Metho bool ILNativeArrayMarshaler::UsePinnedArraySpecialCase() { +#ifndef TIZEN_ASAN_ENVIRONMENT if (IsCLRToNative(m_dwMarshalFlags) && !IsByref(m_dwMarshalFlags) && (NULL != m_pargs->na.m_pArrayMT) && (NULL == OleVariant::GetMarshalerForVarType(m_pargs->na.m_vt, TRUE))) { return true; } - +#endif return false; } |