#include "common.h"
+#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
+
STDAPI_(LPVOID) CoTaskMemAlloc(SIZE_T cb)
{
- return malloc(cb);
+ LPVOID lpRetVal = NULL;
+#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 = malloc(cb);
+ if (!san_enabled) {
+ __sanitizer_disable_interceptors();
+ }
+ }
+ else
+#endif
+ {
+ lpRetVal = malloc(cb);
+ }
+ return lpRetVal;
}
STDAPI_(void) CoTaskMemFree(LPVOID pv)
{
- free(pv);
+#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();
+ }
+ free(pv);
+ if (!san_enabled) {
+ __sanitizer_disable_interceptors();
+ }
+ }
+ else
+#endif
+ {
+ free(pv);
+ }
}
{
// We can't pin an array if we have a marshaler for the var type
// or if we can't get a method-table representing the array (how we determine the offset to pin).
+#ifndef TIZEN_ASAN_ENVIRONMENT
return IsCLRToNative(m_dwMarshalFlags) && !IsByref(m_dwMarshalFlags) && (NULL != m_pargs->na.m_pArrayMT) && (NULL == OleVariant::GetMarshalerForVarType(m_pargs->na.m_vt, TRUE));
+#else
+ return false;
+#endif
}
void ILNativeArrayMarshaler::EmitMarshalViaPinning(ILCodeStream* pslILEmit)