Skip to content

Commit e207071

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: Fix uninitialized lineno in constant AST of internal enums
2 parents 7023fb9 + 08e0729 commit e207071

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PHP NEWS
1212
. Fixed bug GH-15587 (CRC32 API build error on arm 32-bit).
1313
(Bernd Kuhls, Thomas Petazzoni)
1414
. Fixed bug GH-15330 (Do not scan generator frames more than once). (Arnaud)
15+
. Fixed uninitialized lineno in constant AST of internal enums. (ilutov)
1516

1617
- Curl:
1718
. FIxed bug GH-15547 (curl_multi_select overflow on timeout argument).

Zend/zend_enum.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,19 +541,22 @@ static zend_ast_ref *create_enum_case_ast(
541541
ast->child[0]->attr = 0;
542542
ZEND_ASSERT(ZSTR_IS_INTERNED(class_name));
543543
ZVAL_STR(zend_ast_get_zval(ast->child[0]), class_name);
544+
Z_LINENO_P(zend_ast_get_zval(ast->child[0])) = 0;
544545

545546
ast->child[1] = (zend_ast *) p; p += sizeof(zend_ast_zval);
546547
ast->child[1]->kind = ZEND_AST_ZVAL;
547548
ast->child[1]->attr = 0;
548549
ZEND_ASSERT(ZSTR_IS_INTERNED(case_name));
549550
ZVAL_STR(zend_ast_get_zval(ast->child[1]), case_name);
551+
Z_LINENO_P(zend_ast_get_zval(ast->child[1])) = 0;
550552

551553
if (value) {
552554
ast->child[2] = (zend_ast *) p; p += sizeof(zend_ast_zval);
553555
ast->child[2]->kind = ZEND_AST_ZVAL;
554556
ast->child[2]->attr = 0;
555557
ZEND_ASSERT(!Z_REFCOUNTED_P(value));
556558
ZVAL_COPY_VALUE(zend_ast_get_zval(ast->child[2]), value);
559+
Z_LINENO_P(zend_ast_get_zval(ast->child[2])) = 0;
557560
} else {
558561
ast->child[2] = NULL;
559562
}

0 commit comments

Comments
 (0)