Skip to content

Commit d66e87b

Browse files
committed
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 nikic/php-ast#247.
1 parent 2ebd125 commit d66e87b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_ast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ ZEND_API zend_ast * ZEND_FASTCALL zend_ast_create_va(
279279
ast->attr = attr;
280280
for (uint32_t i = 0; i < children; i++) {
281281
ast->child[i] = va_arg(*va, zend_ast *);
282-
if (lineno != (uint32_t)-1 && ast->child[i]) {
282+
if (lineno == (uint32_t)-1 && ast->child[i]) {
283283
lineno = zend_ast_get_lineno(ast->child[i]);
284284
}
285285
}

0 commit comments

Comments
 (0)