com php-src: Add support for MemorySanitizer: Zend/zend_cpuin fo.h

From: Date: Thu, 07 Mar 2019 01:07:28 +0000
Subject: com php-src: Add support for MemorySanitizer: Zend/zend_cpuin fo.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-105037@lists.php.net to get a copy of this message
Commit: 749704cda3cdc52125d19163fbd126a788e8cd19 Author: Stanislav Malyshev <stas@php.net> Wed, 6 Mar 2019 16:18:08 -0800 Parents: 1d0072857b217d758c5aa689da5227974d41589b Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=749704cda3cdc52125d19163fbd126a788e8cd19 Log: Add support for MemorySanitizer Changed paths: M Zend/zend_cpuinfo.h Diff: diff --git a/Zend/zend_cpuinfo.h b/Zend/zend_cpuinfo.h index 942f92c..87bc75c 100644 --- a/Zend/zend_cpuinfo.h +++ b/Zend/zend_cpuinfo.h @@ -100,11 +100,22 @@ typedef enum _zend_cpu_feature { void zend_cpu_startup(); ZEND_API int zend_cpu_supports(zend_cpu_feature feature); +#ifndef __has_attribute +# define __has_attribute(x) 0 +#endif +#ifndef __has_feature +# define __has_feature(x) 0 +#endif + /* Address sanitizer is incompatible with ifunc resolvers, so exclude the * CPU support helpers from asan. * See also https://github.com/google/sanitizers/issues/342. */ #if __has_attribute(no_sanitize_address) -# define ZEND_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) +# if __has_feature(memory_sanitizer) +# define ZEND_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) __attribute__((no_sanitize("memory"))) +# else +# define ZEND_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) +# endif #else # define ZEND_NO_SANITIZE_ADDRESS #endif

« previous php.cvs (#105037) next »