summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-07-01 09:44:53 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-07-01 09:44:53 +0200
commite73cc44021a6549b0382bda90a0f4274c1722b24 (patch)
treeab26d1ad78fe9604bd74af6e86dad669042e5085
parenta0cbc9a7b9e1fe39ccddd85bc19a571d14986680 (diff)
parent5c0a9a4096081b7256dcf5410cce2ae03ffbe041 (diff)
downloadphp-git-e73cc44021a6549b0382bda90a0f4274c1722b24.tar.gz
Merge branch 'PHP-7.4'
-rw-r--r--Zend/zend_cpuinfo.h3
-rw-r--r--Zend/zend_portability.h17
-rw-r--r--ext/standard/tests/misc/time_sleep_until_basic.phpt3
3 files changed, 10 insertions, 13 deletions
diff --git a/Zend/zend_cpuinfo.h b/Zend/zend_cpuinfo.h
index 8b84193f17..0b6b54e51a 100644
--- a/Zend/zend_cpuinfo.h
+++ b/Zend/zend_cpuinfo.h
@@ -103,9 +103,6 @@ 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.
diff --git a/Zend/zend_portability.h b/Zend/zend_portability.h
index 9416a362e3..89173642d2 100644
--- a/Zend/zend_portability.h
+++ b/Zend/zend_portability.h
@@ -86,6 +86,9 @@
#ifndef __has_builtin
# define __has_builtin(x) 0
#endif
+#ifndef __has_feature
+# define __has_feature(x) 0
+#endif
#if defined(ZEND_WIN32) && !defined(__clang__)
# define ZEND_ASSUME(c) __assume(c)
@@ -123,10 +126,8 @@
#if defined(HAVE_LIBDL) && !defined(ZEND_WIN32)
-# if defined(__has_feature)
-# if __has_feature(address_sanitizer)
-# define __SANITIZE_ADDRESS__
-# endif
+# if __has_feature(address_sanitizer)
+# define __SANITIZE_ADDRESS__
# endif
# ifndef RTLD_LAZY
@@ -145,7 +146,7 @@
# if defined(RTLD_GROUP) && defined(RTLD_WORLD) && defined(RTLD_PARENT)
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_GROUP | RTLD_WORLD | RTLD_PARENT)
-# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__)
+# elif defined(RTLD_DEEPBIND) && !defined(__SANITIZE_ADDRESS__) && !__has_feature(memory_sanitizer)
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL | RTLD_DEEPBIND)
# else
# define DL_LOAD(libname) dlopen(libname, PHP_RTLD_MODE | RTLD_GLOBAL)
@@ -526,10 +527,8 @@ static zend_always_inline double _zend_get_nan(void) /* {{{ */
/* Memory sanitizer is incompatible with ifunc resolvers. Even if the resolver
* is marked as no_sanitize("memory") it will still be instrumented and crash. */
-#if defined(__has_feature)
-# if __has_feature(memory_sanitizer)
-# undef HAVE_FUNC_ATTRIBUTE_IFUNC
-# endif
+#if __has_feature(memory_sanitizer)
+# undef HAVE_FUNC_ATTRIBUTE_IFUNC
#endif
#if defined(HAVE_FUNC_ATTRIBUTE_IFUNC) && defined(HAVE_FUNC_ATTRIBUTE_TARGET)
diff --git a/ext/standard/tests/misc/time_sleep_until_basic.phpt b/ext/standard/tests/misc/time_sleep_until_basic.phpt
index 25c17ab9a7..b0d3c8eea5 100644
--- a/ext/standard/tests/misc/time_sleep_until_basic.phpt
+++ b/ext/standard/tests/misc/time_sleep_until_basic.phpt
@@ -29,7 +29,8 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
$now = $tmp >= (int)$time ? $tmp : $tmp + .05;
}
-if ($now >= $sleepUntil) {
+// Add some tolerance for early wake on macos. Reason unknown.
+if ($now + 0.001 >= $sleepUntil) {
echo "Success\n";
} else {
echo "Sleep until (before truncation): ", $time, "\n";