@@ -8261,7 +8261,7 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
82618261 ZEND_CONSTANT_SET_FLAGS (& c , 0 , PHP_USER_CONSTANT );
82628262 c .name = zend_string_copy (Z_STR_P (name ));
82638263
8264- if (zend_register_constant (& c ) == FAILURE ) {
8264+ if (zend_register_constant (& c ) == NULL ) {
82658265 }
82668266
82678267 FREE_OP1 ();
@@ -8274,7 +8274,7 @@ ZEND_VM_HANDLER(210, ZEND_DECLARE_ATTRIBUTED_CONST, CONST, CONST)
82748274 USE_OPLINE
82758275 zval * name ;
82768276 zval * val ;
8277- zend_constant c ;
8277+ zend_constant c , * registered ;
82788278
82798279 SAVE_OPLINE ();
82808280 name = GET_OP1_ZVAL_PTR (BP_VAR_R );
@@ -8293,17 +8293,16 @@ ZEND_VM_HANDLER(210, ZEND_DECLARE_ATTRIBUTED_CONST, CONST, CONST)
82938293 ZEND_CONSTANT_SET_FLAGS (& c , 0 , PHP_USER_CONSTANT );
82948294 c .name = zend_string_copy (Z_STR_P (name ));
82958295
8296- if (zend_register_constant (& c ) == FAILURE ) {
8296+ registered = zend_register_constant (& c );
8297+ if (registered == NULL ) {
82978298 FREE_OP1 ();
82988299 FREE_OP2 ();
82998300 /* two opcodes used, second one is the data with attributes */
83008301 ZEND_VM_NEXT_OPCODE_EX (1 , 2 );
83018302 }
83028303
83038304 HashTable * attributes = Z_PTR_P (GET_OP_DATA_ZVAL_PTR (BP_VAR_R ));
8304- zend_constant * registered = zend_get_constant_ptr (c .name );
83058305 ZEND_ASSERT (attributes != NULL );
8306- ZEND_ASSERT (registered != NULL );
83078306 zend_constant_add_attributes (registered , attributes );
83088307
83098308 FREE_OP1 ();
0 commit comments