mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1279096 - Exclude ffi_call from ASAN. r=decoder
This commit is contained in:
parent
03b9057a17
commit
6976cfdc58
31
js/src/ctypes/libffi-patches/03-asan.patch
Normal file
31
js/src/ctypes/libffi-patches/03-asan.patch
Normal 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;
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user