Skip to content

Commit 4b1491a

Browse files
committed
Remove dubious memcmp optimization in iconv
This violates strict aliasing, and appears entirely unnecessary -- the compiler can optimize fixed size memcmp's by itself.
1 parent b6b98bd commit 4b1491a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/iconv/iconv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#include "ext/standard/quot_print.h"
5656

5757
#define _php_iconv_memequal(a, b, c) \
58-
((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))
58+
(memcmp(a, b, c) == 0)
5959

6060
/* {{{ arginfo */
6161
ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_strlen, 0, 0, 1)

0 commit comments

Comments
 (0)