From e433c23b96e81340cd0e2d0b4b7f5fce7f72a931 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 15 Apr 2017 18:06:42 +0200 Subject: [PATCH] Improve accuracy of opline lineno information If compile_var() was used instead of compile_expr() we did not update the current lineno. --- Zend/tests/bug72101.phpt | 2 +- Zend/zend_compile.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Zend/tests/bug72101.phpt b/Zend/tests/bug72101.phpt index a04425cee4..8782b8e264 100644 --- a/Zend/tests/bug72101.phpt +++ b/Zend/tests/bug72101.phpt @@ -79,7 +79,7 @@ Stack trace: #0 %sbug72101.php(8): {closure}(2, 'Parameter 1 to ...', '%s', 8, Array) #1 %sbug72101.php(27): PHPUnit_Framework_MockObject_Stub_ReturnCallback->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static)) #2 %sbug72101.php(19): PHPUnit_Framework_MockObject_Matcher->invoked(Object(PHPUnit_Framework_MockObject_Invocation_Static)) -#3 %sbug72101.php(51): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static)) +#3 %sbug72101.php(52): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static)) #4 %sbug72101.php(72): Mock_MethodCallbackByReference_7b180d26->bar(0, 0, 0) #5 {main} thrown in %sbug72101.php on line 61 diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index f3c04b9d1c..9e0621d783 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -7314,6 +7314,8 @@ void zend_compile_expr(znode *result, zend_ast *ast) /* {{{ */ void zend_compile_var(znode *result, zend_ast *ast, uint32_t type) /* {{{ */ { + CG(zend_lineno) = zend_ast_get_lineno(ast); + switch (ast->kind) { case ZEND_AST_VAR: zend_compile_simple_var(result, ast, type, 0); -- 2.40.0