diff options
author | Nikita Popov <nikic@php.net> | 2014-07-12 17:10:10 +0200 |
---|---|---|
committer | Nikita Popov <nikic@php.net> | 2014-07-12 17:10:10 +0200 |
commit | 069da161cfb6328b512ee07d0c71b8348f54cf96 (patch) | |
tree | 73ea6c42a1c30605b2931cd59dfc942b55c99c2d /Zend/zend_ast.c | |
parent | c58079b4fda6c23f112347ab208038480cfd6704 (diff) | |
download | php-git-069da161cfb6328b512ee07d0c71b8348f54cf96.tar.gz |
approx correct linenos in errors
Diffstat (limited to 'Zend/zend_ast.c')
-rw-r--r-- | Zend/zend_ast.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index a1ebf7727d..5ef590d2e7 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -48,19 +48,27 @@ ZEND_API zend_ast *zend_ast_create_zval_ex(zval *zv, zend_ast_attr attr) static zend_ast *zend_ast_create_from_va_list( zend_uint children, zend_ast_kind kind, zend_ast_attr attr, va_list va ) { - TSRMLS_FETCH(); + /*TSRMLS_FETCH();*/ zend_uint i; - - zend_ast *ast = emalloc(sizeof(zend_ast) + (children - 1) * sizeof(zend_ast *)); + zend_ast *ast; + + ast = emalloc(sizeof(zend_ast) + (children - 1) * sizeof(zend_ast *)); ast->kind = kind; ast->attr = attr; - ast->lineno = CG(zend_lineno); + ast->lineno = 0; ast->children = children; for (i = 0; i < children; ++i) { ast->child[i] = va_arg(va, zend_ast *); + if (ast->lineno == 0 && ast->child[i] != NULL) { + ast->lineno = ast->child[i]->lineno; + } } + /*if (ast->lineno == 0) { + ast->lineno = CG(zend_lineno); + }*/ + return ast; } |