Skip to content

Commit 8f0729c

Browse files
committed
Merge branch 'PHP-7.4'
2 parents aa2320b + 45ab573 commit 8f0729c

File tree

7 files changed

+16
-22
lines changed

7 files changed

+16
-22
lines changed

Zend/zend_cpuinfo.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,7 @@ ZEND_API int zend_cpu_supports(zend_cpu_feature feature);
111111
* CPU support helpers from asan.
112112
* See also https://github.com/google/sanitizers/issues/342. */
113113
#if __has_attribute(no_sanitize_address)
114-
# if __has_feature(memory_sanitizer)
115-
# define ZEND_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) __attribute__((no_sanitize("memory")))
116-
# else
117-
# define ZEND_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
118-
# endif
114+
# define ZEND_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address))
119115
#else
120116
# define ZEND_NO_SANITIZE_ADDRESS
121117
#endif

Zend/zend_portability.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,14 @@ static zend_always_inline double _zend_get_nan(void) /* {{{ */
524524

525525
/* Intrinsics macros start. */
526526

527+
/* Memory sanitizer is incompatible with ifunc resolvers. Even if the resolver
528+
* is marked as no_sanitize("memory") it will still be instrumented and crash. */
529+
#if defined(__has_feature)
530+
# if __has_feature(memory_sanitizer)
531+
# undef HAVE_FUNC_ATTRIBUTE_IFUNC
532+
# endif
533+
#endif
534+
527535
#if defined(HAVE_FUNC_ATTRIBUTE_IFUNC) && defined(HAVE_FUNC_ATTRIBUTE_TARGET)
528536
# define ZEND_INTRIN_HAVE_IFUNC_TARGET 1
529537
#endif

ext/standard/base64.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ PHPAPI zend_string *php_base64_encode(const unsigned char *str, size_t length) _
217217
PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length, zend_bool strict) __attribute__((ifunc("resolve_base64_decode")));
218218

219219
ZEND_NO_SANITIZE_ADDRESS
220+
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
220221
static void *resolve_base64_encode() {
221222
# if ZEND_INTRIN_AVX2_FUNC_PROTO
222223
if (zend_cpu_supports_avx2()) {
@@ -232,6 +233,7 @@ static void *resolve_base64_encode() {
232233
}
233234

234235
ZEND_NO_SANITIZE_ADDRESS
236+
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
235237
static void *resolve_base64_decode() {
236238
# if ZEND_INTRIN_AVX2_FUNC_PROTO
237239
if (zend_cpu_supports_avx2()) {

ext/standard/string.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3723,6 +3723,7 @@ PHPAPI zend_string *php_addslashes(zend_string *str) __attribute__((ifunc("resol
37233723
PHPAPI void php_stripslashes(zend_string *str) __attribute__((ifunc("resolve_stripslashes")));
37243724

37253725
ZEND_NO_SANITIZE_ADDRESS
3726+
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
37263727
static void *resolve_addslashes() {
37273728
if (zend_cpu_supports_sse42()) {
37283729
return php_addslashes_sse42;
@@ -3731,6 +3732,7 @@ static void *resolve_addslashes() {
37313732
}
37323733

37333734
ZEND_NO_SANITIZE_ADDRESS
3735+
ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */
37343736
static void *resolve_stripslashes() {
37353737
if (zend_cpu_supports_sse42()) {
37363738
return php_stripslashes_sse42;

sapi/phpdbg/phpdbg_eol.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ struct phpdbg_eol_rep phpdbg_eol_list[EOL_LIST_LEN] = {
3636
int phpdbg_eol_global_update(char *name)
3737
{
3838

39-
if (0 == memcmp(name, "CRLF", 4) || 0 == memcmp(name, "crlf", 4) || 0 == memcmp(name, "DOS", 3) || 0 == memcmp(name, "dos", 3)) {
39+
if (0 == strcmp(name, "CRLF") || 0 == strcmp(name, "crlf") || 0 == strcmp(name, "DOS") || 0 == strcmp(name, "dos")) {
4040
PHPDBG_G(eol) = PHPDBG_EOL_CRLF;
41-
} else if (0 == memcmp(name, "LF", 2) || 0 == memcmp(name, "lf", 2) || 0 == memcmp(name, "UNIX", 4) || 0 == memcmp(name, "unix", 4)) {
41+
} else if (0 == strcmp(name, "LF") || 0 == strcmp(name, "lf") || 0 == strcmp(name, "UNIX") || 0 == strcmp(name, "unix")) {
4242
PHPDBG_G(eol) = PHPDBG_EOL_LF;
43-
} else if (0 == memcmp(name, "CR", 2) || 0 == memcmp(name, "cr", 2) || 0 == memcmp(name, "MAC", 3) || 0 == memcmp(name, "mac", 3)) {
43+
} else if (0 == strcmp(name, "CR") || 0 == strcmp(name, "cr") || 0 == strcmp(name, "MAC") || 0 == strcmp(name, "mac")) {
4444
PHPDBG_G(eol) = PHPDBG_EOL_CR;
4545
} else {
4646
return FAILURE;

sapi/phpdbg/phpdbg_out.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -863,17 +863,6 @@ PHPDBG_API int phpdbg_xml_vasprintf(char **buf, const char *format, zend_bool es
863863
}
864864
/* copy end */
865865

866-
PHPDBG_API int _phpdbg_xml_asprintf(char **buf, const char *format, zend_bool escape_xml, ...) {
867-
int ret;
868-
va_list va;
869-
870-
va_start(va, escape_xml);
871-
ret = phpdbg_xml_vasprintf(buf, format, escape_xml, va);
872-
va_end(va);
873-
874-
return ret;
875-
}
876-
877866
PHPDBG_API int _phpdbg_asprintf(char **buf, const char *format, ...) {
878867
int ret;
879868
va_list va;

sapi/phpdbg/phpdbg_out.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ PHPDBG_API int phpdbg_rlog_internal(int fd, const char *fmt, ...) PHPDBG_ATTRIBU
6767

6868
#define phpdbg_rlog(fd, fmt, ...) phpdbg_rlog_internal(fd, fmt, ##__VA_ARGS__)
6969

70-
#define phpdbg_xml_asprintf(buf, ...) _phpdbg_xml_asprintf(buf, ##__VA_ARGS__)
71-
PHPDBG_API int _phpdbg_xml_asprintf(char **buf, const char *format, zend_bool escape_xml, ...);
72-
7370
#define phpdbg_asprintf(buf, ...) _phpdbg_asprintf(buf, ##__VA_ARGS__)
7471
PHPDBG_API int _phpdbg_asprintf(char **buf, const char *format, ...);
7572

0 commit comments

Comments
 (0)