Skip to content

Commit e3e3547

Browse files
committed
Merge branch 'PHP-7.0' into PHP-7.1
2 parents 7835e2e + d719b46 commit e3e3547

File tree

6 files changed

+4192
-3997
lines changed

6 files changed

+4192
-3997
lines changed

Zend/zend_ast.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,21 @@ ZEND_API zend_ast *zend_ast_create_znode(znode *node) {
5757
return (zend_ast *) ast;
5858
}
5959

60-
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
60+
ZEND_API zend_ast *zend_ast_create_zval_with_lineno(zval *zv, zend_ast_attr attr, uint32_t lineno) {
6161
zend_ast_zval *ast;
6262

6363
ast = zend_ast_alloc(sizeof(zend_ast_zval));
6464
ast->kind = ZEND_AST_ZVAL;
6565
ast->attr = attr;
6666
ZVAL_COPY_VALUE(&ast->val, zv);
67-
ast->val.u2.lineno = CG(zend_lineno);
67+
ast->val.u2.lineno = lineno;
6868
return (zend_ast *) ast;
6969
}
7070

71+
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) {
72+
return zend_ast_create_zval_with_lineno(zv, attr, CG(zend_lineno));
73+
}
74+
7175
ZEND_API zend_ast *zend_ast_create_decl(
7276
zend_ast_kind kind, uint32_t flags, uint32_t start_lineno, zend_string *doc_comment,
7377
zend_string *name, zend_ast *child0, zend_ast *child1, zend_ast *child2, zend_ast *child3

Zend/zend_ast.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ typedef struct _zend_ast_decl {
189189
typedef void (*zend_ast_process_t)(zend_ast *ast);
190190
extern ZEND_API zend_ast_process_t zend_ast_process;
191191

192+
ZEND_API zend_ast *zend_ast_create_zval_with_lineno(zval *zv, zend_ast_attr attr, uint32_t lineno);
192193
ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr);
193194

194195
ZEND_API zend_ast *zend_ast_create_ex(zend_ast_kind kind, zend_ast_attr attr, ...);

Zend/zend_compile.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1690,6 +1690,7 @@ int zendlex(zend_parser_stack_elem *elem) /* {{{ */
16901690
{
16911691
zval zv;
16921692
int retval;
1693+
uint32_t start_lineno;
16931694

16941695
if (CG(increment_lineno)) {
16951696
CG(zend_lineno)++;
@@ -1698,6 +1699,7 @@ int zendlex(zend_parser_stack_elem *elem) /* {{{ */
16981699

16991700
again:
17001701
ZVAL_UNDEF(&zv);
1702+
start_lineno = CG(zend_lineno);
17011703
retval = lex_scan(&zv);
17021704
if (EG(exception)) {
17031705
return T_ERROR;
@@ -1721,7 +1723,7 @@ int zendlex(zend_parser_stack_elem *elem) /* {{{ */
17211723
break;
17221724
}
17231725
if (Z_TYPE(zv) != IS_UNDEF) {
1724-
elem->ast = zend_ast_create_zval(&zv);
1726+
elem->ast = zend_ast_create_zval_with_lineno(&zv, 0, start_lineno);
17251727
}
17261728

17271729
return retval;

0 commit comments

Comments
 (0)