diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-04-12 15:10:17 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-04-12 15:12:39 +0200 |
commit | 4b1491a7b1cb334f9d1f552d21ea1a4448fb3c40 (patch) | |
tree | 4a94ac8e039b49c944e07884432def4802ad5113 /ext/iconv/iconv.c | |
parent | b6b98bdf641c9d054638c60ec9bb3199d3164303 (diff) | |
download | php-git-4b1491a7b1cb334f9d1f552d21ea1a4448fb3c40.tar.gz |
Remove dubious memcmp optimization in iconv
This violates strict aliasing, and appears entirely unnecessary --
the compiler can optimize fixed size memcmp's by itself.
Diffstat (limited to 'ext/iconv/iconv.c')
-rw-r--r-- | ext/iconv/iconv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 0e85a5c3b3..62f7cb3af1 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -55,7 +55,7 @@ #include "ext/standard/quot_print.h" #define _php_iconv_memequal(a, b, c) \ - ((c) == sizeof(zend_ulong) ? *((zend_ulong *)(a)) == *((zend_ulong *)(b)) : ((c) == sizeof(unsigned int) ? *((unsigned int *)(a)) == *((unsigned int *)(b)) : memcmp(a, b, c) == 0)) + (memcmp(a, b, c) == 0) /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_strlen, 0, 0, 1) |