mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix line assignment in zend_ast_create_va()
The intent here was to assign the first found line. Instead this always fell back to CG(zend_lineno). Not sure if this line matters for anything in php-src, but the issue was observed in https://github.com/nikic/php-ast/issues/247.
This commit is contained in:
@@ -279,7 +279,7 @@ ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_va(
|
||||
ast->attr = attr;
|
||||
for (uint32_t i = 0; i < children; i++) {
|
||||
ast->child[i] = va_arg(*va, zend_ast *);
|
||||
if (lineno != (uint32_t)-1 && ast->child[i]) {
|
||||
if (lineno == (uint32_t)-1 && ast->child[i]) {
|
||||
lineno = zend_ast_get_lineno(ast->child[i]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user