diff options
author | Dmitry Stogov <dmitry@zend.com> | 2018-07-26 12:58:07 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2018-07-26 12:58:07 +0300 |
commit | ab8094c666048b747481df0b9da94e08cadc4160 (patch) | |
tree | 3ac94d92f4b07fe2d1d98db81203c85572bea82c /ext | |
parent | 7a41e4c0d0ddb2cfb91e31b210d7bceb158d2ab4 (diff) | |
download | php-git-ab8094c666048b747481df0b9da94e08cadc4160.tar.gz |
Pack zend_constant.flags and zend_constant.module_number into reserved space inside zend_constant.value.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/opcache/Optimizer/block_pass.c | 6 | ||||
-rw-r--r-- | ext/reflection/php_reflection.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index 3fe25a3691..7700d0dea0 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -44,7 +44,7 @@ int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int zend_str_tolower(lookup_name, ZSTR_LEN(name)); if ((c = zend_hash_str_find_ptr(EG(zend_constants), lookup_name, ZSTR_LEN(name))) != NULL) { - if (!(c->flags & CONST_CT_SUBST) || (c->flags & CONST_CS)) { + if (!(ZEND_CONSTANT_FLAGS(c) & CONST_CT_SUBST) || (ZEND_CONSTANT_FLAGS(c) & CONST_CS)) { retval = 0; } } else { @@ -54,8 +54,8 @@ int zend_optimizer_get_persistent_constant(zend_string *name, zval *result, int } if (retval) { - if ((c->flags & CONST_PERSISTENT) - && (!(c->flags & CONST_NO_FILE_CACHE) + if ((ZEND_CONSTANT_FLAGS(c) & CONST_PERSISTENT) + && (!(ZEND_CONSTANT_FLAGS(c) & CONST_NO_FILE_CACHE) || !(CG(compiler_options) & ZEND_COMPILE_WITH_FILE_CACHE))) { ZVAL_COPY_VALUE(result, &c->value); if (copy) { diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 87220dd7d3..862936d81c 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -926,7 +926,7 @@ static int _extension_const_string(zval *el, int num_args, va_list args, zend_ha struct _zend_module_entry *module = va_arg(args, struct _zend_module_entry*); int *num_classes = va_arg(args, int*); - if (constant->module_number == module->module_number) { + if (ZEND_CONSTANT_MODULE_NUMBER(constant) == module->module_number) { _const_string(str, ZSTR_VAL(constant->name), &constant->value, indent); (*num_classes)++; } @@ -5696,7 +5696,7 @@ static int _addconstant(zval *el, int num_args, va_list args, zend_hash_key *has zval *retval = va_arg(args, zval*); int number = va_arg(args, int); - if (number == constant->module_number) { + if (number == ZEND_CONSTANT_MODULE_NUMBER(constant)) { ZVAL_COPY_OR_DUP(&const_val, &constant->value); zend_hash_update(Z_ARRVAL_P(retval), constant->name, &const_val); } |