Skip to content

Commit 08e0729

Browse files
committed
Fix uninitialized lineno in constant AST of internal enums
Closes GH-15806
1 parent 5fc37b1 commit 08e0729

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
@@ -534,19 +534,22 @@ static zend_ast_ref *create_enum_case_ast(
534534
ast->child[0]->attr = 0;
535535
ZEND_ASSERT(ZSTR_IS_INTERNED(class_name));
536536
ZVAL_STR(zend_ast_get_zval(ast->child[0]), class_name);
537+
Z_LINENO_P(zend_ast_get_zval(ast->child[0])) = 0;
537538

538539
ast->child[1] = (zend_ast *) p; p += sizeof(zend_ast_zval);
539540
ast->child[1]->kind = ZEND_AST_ZVAL;
540541
ast->child[1]->attr = 0;
541542
ZEND_ASSERT(ZSTR_IS_INTERNED(case_name));
542543
ZVAL_STR(zend_ast_get_zval(ast->child[1]), case_name);
544+
Z_LINENO_P(zend_ast_get_zval(ast->child[1])) = 0;
543545

544546
if (value) {
545547
ast->child[2] = (zend_ast *) p; p += sizeof(zend_ast_zval);
546548
ast->child[2]->kind = ZEND_AST_ZVAL;
547549
ast->child[2]->attr = 0;
548550
ZEND_ASSERT(!Z_REFCOUNTED_P(value));
549551
ZVAL_COPY_VALUE(zend_ast_get_zval(ast->child[2]), value);
552+
Z_LINENO_P(zend_ast_get_zval(ast->child[2])) = 0;
550553
} else {
551554
ast->child[2] = NULL;
552555
}

0 commit comments

Comments
 (0)