summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-04-15 18:06:42 +0200
committerNikita Popov <nikita.ppv@gmail.com>2017-04-15 18:15:24 +0200
commite433c23b96e81340cd0e2d0b4b7f5fce7f72a931 (patch)
tree58aa6b8a96b9d24ae493e26a16fd8e31890e5c59
parent0beccc51f1bf44fb3efeb1131f8c86eb7dc5014f (diff)
downloadphp-git-e433c23b96e81340cd0e2d0b4b7f5fce7f72a931.tar.gz
Improve accuracy of opline lineno information
If compile_var() was used instead of compile_expr() we did not update the current lineno.
-rw-r--r--Zend/tests/bug72101.phpt2
-rw-r--r--Zend/zend_compile.c2
2 files changed, 3 insertions, 1 deletions
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);