File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -417,15 +417,14 @@ ZEND_API zend_class_entry *zend_register_internal_enum(
417
417
static zend_ast_ref * create_enum_case_ast (
418
418
zend_string * class_name , zend_string * case_name , zval * value ) {
419
419
// TODO: Use custom node type for enum cases?
420
- size_t num_children = value ? 3 : 2 ;
421
- size_t size = sizeof (zend_ast_ref ) + zend_ast_size (num_children )
422
- + num_children * sizeof (zend_ast_zval );
420
+ size_t size = sizeof (zend_ast_ref ) + zend_ast_size (3 )
421
+ + (value ? 3 : 2 ) * sizeof (zend_ast_zval );
423
422
char * p = pemalloc (size , 1 );
424
423
zend_ast_ref * ref = (zend_ast_ref * ) p ; p += sizeof (zend_ast_ref );
425
424
GC_SET_REFCOUNT (ref , 1 );
426
425
GC_TYPE_INFO (ref ) = GC_CONSTANT_AST | GC_PERSISTENT | GC_IMMUTABLE ;
427
426
428
- zend_ast * ast = (zend_ast * ) p ; p += zend_ast_size (num_children );
427
+ zend_ast * ast = (zend_ast * ) p ; p += zend_ast_size (3 );
429
428
ast -> kind = ZEND_AST_CONST_ENUM_INIT ;
430
429
ast -> attr = 0 ;
431
430
ast -> lineno = 0 ;
You can’t perform that action at this time.
0 commit comments