Bug 1279096 - Exclude ffi_call from ASAN. r=decoder

This commit is contained in:
Mike Hommey 2016-06-09 08:48:39 +09:00
parent 03b9057a17
commit 6976cfdc58
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,31 @@
diff --git a/js/src/ctypes/libffi/src/x86/ffi64.c b/js/src/ctypes/libffi/src/x86/ffi64.c
index 5a5e043..0594119 100644
--- a/js/src/ctypes/libffi/src/x86/ffi64.c
+++ b/js/src/ctypes/libffi/src/x86/ffi64.c
@@ -414,16 +414,26 @@ ffi_prep_cif_machdep (ffi_cif *cif)
if (ssecount)
flags |= 1 << 11;
cif->flags = flags;
cif->bytes = (unsigned)ALIGN (bytes, 8);
return FFI_OK;
}
+#ifndef __SANITIZE_ADDRESS__
+# ifdef __clang__
+# if __has_feature(address_sanitizer)
+# define __SANITIZE_ADDRESS__
+# endif
+# endif
+#endif
+#ifdef __SANITIZE_ADDRESS__
+__attribute__((noinline,no_sanitize_address))
+#endif
void
ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
{
enum x86_64_reg_class classes[MAX_CLASSES];
char *stack, *argp;
ffi_type **arg_types;
int gprcount, ssecount, ngpr, nsse, i, avn;
_Bool ret_in_memory;

View File

@ -419,6 +419,16 @@ ffi_prep_cif_machdep (ffi_cif *cif)
return FFI_OK;
}
#ifndef __SANITIZE_ADDRESS__
# ifdef __clang__
# if __has_feature(address_sanitizer)
# define __SANITIZE_ADDRESS__
# endif
# endif
#endif
#ifdef __SANITIZE_ADDRESS__
__attribute__((noinline,no_sanitize_address))
#endif
void
ffi_call (ffi_cif *cif, void (*fn)(void), void *rvalue, void **avalue)
{