]> granicus.if.org Git - php/commitdiff
Fixed bug #76046
authorNikita Popov <nikita.ppv@gmail.com>
Tue, 27 Nov 2018 15:37:55 +0000 (16:37 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Tue, 27 Nov 2018 15:37:55 +0000 (16:37 +0100)
Place FE_FREE on start line of foreach, instead of whatever random
line number might be in CG(zend_lineno) at the time.

NEWS
Zend/zend_compile.c

diff --git a/NEWS b/NEWS
index 9b80edf8c15e29d5a858e1a89042649d35eaaa3c..83b123e4d31afb2eae7e56a0e7ae73f48bba82f2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,8 @@ PHP                                                                        NEWS
 - Core:
   . Fixed bug #71041 (zend_signal_startup() needs ZEND_API).
     (Valentin V. Bartenev)
+  . Fixed bug #76046 (PHP generates "FE_FREE" opcode on the wrong line).
+    (Nikita)
 
 - COM:
   . Fixed bug #77177 (Serializing or unserializing COM objects crashes). (cmb)
index f1dd49a223bd96b011333aabbce7fd348087a322..9c0893b773992fd9fac9585221ef29247352b3c2 100644 (file)
@@ -4807,6 +4807,7 @@ void zend_compile_foreach(zend_ast *ast) /* {{{ */
 
        zend_end_loop(opnum_fetch, &reset_node);
 
+       CG(zend_lineno) = ast->lineno;
        opline = zend_emit_op(NULL, ZEND_FE_FREE, &reset_node, NULL);
 }
 /* }}} */