From 027ead91e5424a759b01f447444eee668ac43ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 10 Aug 2015 17:44:53 +0200 Subject: [PATCH] Disable padlock asm with ASan Causes errors with some versions of ASan --- include/polarssl/padlock.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/include/polarssl/padlock.h b/include/polarssl/padlock.h index 55a0395a0..c4ac54cb9 100644 --- a/include/polarssl/padlock.h +++ b/include/polarssl/padlock.h @@ -29,7 +29,15 @@ #define POLARSSL_ERR_PADLOCK_DATA_MISALIGNED -0x0030 /**< Input data should be aligned. */ -#if defined(POLARSSL_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) +#if defined(__has_feature) +#if __has_feature(address_sanitizer) +#define POLARSSL_HAVE_ASAN +#endif +#endif + +/* Some versions of ASan result in errors about not enough registers */ +#if defined(POLARSSL_HAVE_ASM) && defined(__GNUC__) && defined(__i386__) && \ + !defined(POLARSSL_HAVE_ASAN) #ifndef POLARSSL_HAVE_X86 #define POLARSSL_HAVE_X86