mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
Merge branch 'PHP-7.4'
This commit is contained in:
commit
8f0729cb65
@ -111,11 +111,7 @@ ZEND_API int zend_cpu_supports(zend_cpu_feature feature);
|
||||
* CPU support helpers from asan.
|
||||
* See also https://github.com/google/sanitizers/issues/342. */
|
||||
#if __has_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
|
||||
# define ZEND_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
|
||||
#else
|
||||
# define ZEND_NO_SANITIZE_ADDRESS
|
||||
#endif
|
||||
|
@ -524,6 +524,14 @@ static zend_always_inline double _zend_get_nan(void) /* {{{ */
|
||||
|
||||
/* Intrinsics macros start. */
|
||||
|
||||
/* 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
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_FUNC_ATTRIBUTE_IFUNC) && defined(HAVE_FUNC_ATTRIBUTE_TARGET)
|
||||
# define ZEND_INTRIN_HAVE_IFUNC_TARGET 1
|
||||
#endif
|
||||
|
@ -217,6 +217,7 @@ PHPAPI zend_string *php_base64_encode(const unsigned char *str, size_t length) _
|
||||
PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length, zend_bool strict) __attribute__((ifunc("resolve_base64_decode")));
|
||||
|
||||
ZEND_NO_SANITIZE_ADDRESS
|
||||
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
|
||||
static void *resolve_base64_encode() {
|
||||
# if ZEND_INTRIN_AVX2_FUNC_PROTO
|
||||
if (zend_cpu_supports_avx2()) {
|
||||
@ -232,6 +233,7 @@ static void *resolve_base64_encode() {
|
||||
}
|
||||
|
||||
ZEND_NO_SANITIZE_ADDRESS
|
||||
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
|
||||
static void *resolve_base64_decode() {
|
||||
# if ZEND_INTRIN_AVX2_FUNC_PROTO
|
||||
if (zend_cpu_supports_avx2()) {
|
||||
|
@ -3723,6 +3723,7 @@ PHPAPI zend_string *php_addslashes(zend_string *str) __attribute__((ifunc("resol
|
||||
PHPAPI void php_stripslashes(zend_string *str) __attribute__((ifunc("resolve_stripslashes")));
|
||||
|
||||
ZEND_NO_SANITIZE_ADDRESS
|
||||
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
|
||||
static void *resolve_addslashes() {
|
||||
if (zend_cpu_supports_sse42()) {
|
||||
return php_addslashes_sse42;
|
||||
@ -3731,6 +3732,7 @@ static void *resolve_addslashes() {
|
||||
}
|
||||
|
||||
ZEND_NO_SANITIZE_ADDRESS
|
||||
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
|
||||
static void *resolve_stripslashes() {
|
||||
if (zend_cpu_supports_sse42()) {
|
||||
return php_stripslashes_sse42;
|
||||
|
@ -36,11 +36,11 @@ struct phpdbg_eol_rep phpdbg_eol_list[EOL_LIST_LEN] = {
|
||||
int phpdbg_eol_global_update(char *name)
|
||||
{
|
||||
|
||||
if (0 == memcmp(name, "CRLF", 4) || 0 == memcmp(name, "crlf", 4) || 0 == memcmp(name, "DOS", 3) || 0 == memcmp(name, "dos", 3)) {
|
||||
if (0 == strcmp(name, "CRLF") || 0 == strcmp(name, "crlf") || 0 == strcmp(name, "DOS") || 0 == strcmp(name, "dos")) {
|
||||
PHPDBG_G(eol) = PHPDBG_EOL_CRLF;
|
||||
} else if (0 == memcmp(name, "LF", 2) || 0 == memcmp(name, "lf", 2) || 0 == memcmp(name, "UNIX", 4) || 0 == memcmp(name, "unix", 4)) {
|
||||
} else if (0 == strcmp(name, "LF") || 0 == strcmp(name, "lf") || 0 == strcmp(name, "UNIX") || 0 == strcmp(name, "unix")) {
|
||||
PHPDBG_G(eol) = PHPDBG_EOL_LF;
|
||||
} else if (0 == memcmp(name, "CR", 2) || 0 == memcmp(name, "cr", 2) || 0 == memcmp(name, "MAC", 3) || 0 == memcmp(name, "mac", 3)) {
|
||||
} else if (0 == strcmp(name, "CR") || 0 == strcmp(name, "cr") || 0 == strcmp(name, "MAC") || 0 == strcmp(name, "mac")) {
|
||||
PHPDBG_G(eol) = PHPDBG_EOL_CR;
|
||||
} else {
|
||||
return FAILURE;
|
||||
|
@ -863,17 +863,6 @@ PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, zend_bool es
|
||||
}
|
||||
/* copy end */
|
||||
|
||||
PHPDBG_API int _phpdbg_xml_asprintf(char **buf, const char *format, zend_bool escape_xml, ...) {
|
||||
int ret;
|
||||
va_list va;
|
||||
|
||||
va_start(va, escape_xml);
|
||||
ret = phpdbg_xml_vasprintf(buf, format, escape_xml, va);
|
||||
va_end(va);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
PHPDBG_API int _phpdbg_asprintf(char **buf, const char *format, ...) {
|
||||
int ret;
|
||||
va_list va;
|
||||
|
@ -67,9 +67,6 @@ PHPDBG_API int phpdbg_rlog_internal(int fd, const char *fmt, ...) PHPDBG_ATTRIBU
|
||||
|
||||
#define phpdbg_rlog(fd, fmt, ...) phpdbg_rlog_internal(fd, fmt, ##__VA_ARGS__)
|
||||
|
||||
#define phpdbg_xml_asprintf(buf, ...) _phpdbg_xml_asprintf(buf, ##__VA_ARGS__)
|
||||
PHPDBG_API int _phpdbg_xml_asprintf(char **buf, const char *format, zend_bool escape_xml, ...);
|
||||
|
||||
#define phpdbg_asprintf(buf, ...) _phpdbg_asprintf(buf, ##__VA_ARGS__)
|
||||
PHPDBG_API int _phpdbg_asprintf(char **buf, const char *format, ...);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user