com php-src: Fixed breaks of strict-aliasing rules: Zend/zend_compile.h
| From: | Dmitry Stogov | Date: | Fri, 29 Apr 2016 10:11:27 +0000 |
| Subject: | com php-src: Fixed breaks of strict-aliasing rules: Zend/zend_compile.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91947@lists.php.net to get a copy of this message | ||
Commit: 71842c2828018f0a6ddd6403f1cdbc702a4de539
Author: Dmitry Stogov <dmitry@zend.com> Fri, 29 Apr 2016 13:11:27 +0300
Parents: dfe092b22efc74e96769b65c32dd7543b8a26f03
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=71842c2828018f0a6ddd6403f1cdbc702a4de539
Log:
Fixed breaks of strict-aliasing rules
Changed paths:
M Zend/zend_compile.h
Diff:
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h
index 6cc16c6..f716dc5 100644
--- a/Zend/zend_compile.h
+++ b/Zend/zend_compile.h
@@ -421,6 +421,7 @@ typedef struct _zend_internal_function {
union _zend_function {
zend_uchar type; /* MUST be the first element of this struct! */
+ uint32_t quick_arg_flags;
struct {
zend_uchar type; /* never used */
@@ -924,16 +925,16 @@ static zend_always_inline int zend_check_arg_send_type(const zend_function
*zf,
#ifdef WORDS_BIGENDIAN
# define ZEND_SET_ARG_FLAG(zf, arg_num, mask) do { \
- *(uint32_t*)&(zf)->type |= ((mask) << ((arg_num) - 1) * 2); \
+ (zf)->quick_arg_flags |= ((mask) << ((arg_num) - 1) * 2); \
} while (0)
# define ZEND_CHECK_ARG_FLAG(zf, arg_num, mask) \
- (((*((uint32_t*)&((zf)->type))) >> (((arg_num) - 1) * 2)) & (mask))
+ (((zf)->quick_arg_flags >> (((arg_num) - 1) * 2)) & (mask))
#else
# define ZEND_SET_ARG_FLAG(zf, arg_num, mask) do { \
- *(uint32_t*)&(zf)->type |= (((mask) << 6) << (arg_num) * 2); \
+ (zf)->quick_arg_flags |= (((mask) << 6) << (arg_num) * 2); \
} while (0)
# define ZEND_CHECK_ARG_FLAG(zf, arg_num, mask) \
- (((*(uint32_t*)&(zf)->type) >> (((arg_num) + 3) * 2)) & (mask))
+ (((zf)->quick_arg_flags >> (((arg_num) + 3) * 2)) & (mask))
#endif
#define QUICK_ARG_MUST_BE_SENT_BY_REF(zf, arg_num) \