Skip to content

Commit

Permalink
Merge branch 'PHP-8.2' into PHP-8.3
Browse files Browse the repository at this point in the history
* PHP-8.2:
  Fix uninitialized lineno in constant AST of internal enums
  • Loading branch information
iluuu1994 committed Sep 8, 2024
2 parents 7023fb9 + 08e0729 commit e207071
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
3 changes: 3 additions & 0 deletions Zend/zend_enum.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,19 +541,22 @@ 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);
ast->child[2]->kind = ZEND_AST_ZVAL;
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;
}
Expand Down

0 comments on commit e207071

Please sign in to comment.