From ab8094c666048b747481df0b9da94e08cadc4160 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 26 Jul 2018 12:58:07 +0300 Subject: Pack zend_constant.flags and zend_constant.module_number into reserved space inside zend_constant.value. --- Zend/zend_builtin_functions.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'Zend/zend_builtin_functions.c') diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 9011c82fc3..4989b4b5b5 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -909,9 +909,9 @@ register_constant: "define(): Declaration of case-insensitive constants is deprecated"); } - c.flags = case_sensitive; /* non persistent */ + /* non persistent */ + ZEND_CONSTANT_SET_FLAGS(&c, case_sensitive, PHP_USER_CONSTANT); c.name = zend_string_copy(name); - c.module_number = PHP_USER_CONSTANT; if (zend_register_constant(&c) == SUCCESS) { RETURN_TRUE; } else { @@ -2145,13 +2145,13 @@ ZEND_FUNCTION(get_defined_constants) continue; } - if (val->module_number == PHP_USER_CONSTANT) { + if (ZEND_CONSTANT_MODULE_NUMBER(val) == PHP_USER_CONSTANT) { module_number = i; - } else if (val->module_number > i || val->module_number < 0) { + } else if (ZEND_CONSTANT_MODULE_NUMBER(val) > i) { /* should not happen */ continue; } else { - module_number = val->module_number; + module_number = ZEND_CONSTANT_MODULE_NUMBER(val); } if (Z_TYPE(modules[module_number]) == IS_UNDEF) { -- cgit v1.2.1