From 08e0729c57755f0cafda04dc0e637fa20db78ebe Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Sun, 8 Sep 2024 18:46:14 +0200 Subject: [PATCH] Fix uninitialized lineno in constant AST of internal enums Closes GH-15806 --- NEWS | 1 + Zend/zend_enum.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 1948d5fe8bafe..603d71ff855b7 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ PHP NEWS . Fixed bug GH-15587 (CRC32 API build error on arm 32-bit). (Bernd Kuhls, Thomas Petazzoni) . Fixed bug GH-15330 (Do not scan generator frames more than once). (Arnaud) + . Fixed uninitialized lineno in constant AST of internal enums. (ilutov) - Curl: . FIxed bug GH-15547 (curl_multi_select overflow on timeout argument). diff --git a/Zend/zend_enum.c b/Zend/zend_enum.c index 85d015b19b77b..9118c620ca445 100644 --- a/Zend/zend_enum.c +++ b/Zend/zend_enum.c @@ -534,12 +534,14 @@ static zend_ast_ref *create_enum_case_ast( ast->child[0]->attr = 0; ZEND_ASSERT(ZSTR_IS_INTERNED(class_name)); ZVAL_STR(zend_ast_get_zval(ast->child[0]), class_name); + Z_LINENO_P(zend_ast_get_zval(ast->child[0])) = 0; ast->child[1] = (zend_ast *) p; p += sizeof(zend_ast_zval); ast->child[1]->kind = ZEND_AST_ZVAL; ast->child[1]->attr = 0; ZEND_ASSERT(ZSTR_IS_INTERNED(case_name)); ZVAL_STR(zend_ast_get_zval(ast->child[1]), case_name); + Z_LINENO_P(zend_ast_get_zval(ast->child[1])) = 0; if (value) { ast->child[2] = (zend_ast *) p; p += sizeof(zend_ast_zval); @@ -547,6 +549,7 @@ static zend_ast_ref *create_enum_case_ast( ast->child[2]->attr = 0; ZEND_ASSERT(!Z_REFCOUNTED_P(value)); ZVAL_COPY_VALUE(zend_ast_get_zval(ast->child[2]), value); + Z_LINENO_P(zend_ast_get_zval(ast->child[2])) = 0; } else { ast->child[2] = NULL; }