From: Dmitry Stogov Date: Fri, 29 Apr 2016 10:11:27 +0000 (+0300) Subject: Fixed breaks of strict-aliasing rules X-Git-Tag: php-7.1.0alpha1~237^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=71842c2828018f0a6ddd6403f1cdbc702a4de539;p=php Fixed breaks of strict-aliasing rules --- diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 6cc16c61b3..f716dc51ff 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) \