Skip to content

Commit d6595f2

Browse files
committed
Fixed bug #76046
Place FE_FREE on start line of foreach, instead of whatever random line number might be in CG(zend_lineno) at the time.
1 parent 9ec519e commit d6595f2

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ PHP NEWS
55
- Core:
66
. Fixed bug #71041 (zend_signal_startup() needs ZEND_API).
77
(Valentin V. Bartenev)
8+
. Fixed bug #76046 (PHP generates "FE_FREE" opcode on the wrong line).
9+
(Nikita)
810

911
- COM:
1012
. Fixed bug #77177 (Serializing or unserializing COM objects crashes). (cmb)

Zend/zend_compile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4807,6 +4807,7 @@ void zend_compile_foreach(zend_ast *ast) /* {{{ */
48074807

48084808
zend_end_loop(opnum_fetch, &reset_node);
48094809

4810+
CG(zend_lineno) = ast->lineno;
48104811
opline = zend_emit_op(NULL, ZEND_FE_FREE, &reset_node, NULL);
48114812
}
48124813
/* }}} */

0 commit comments

Comments
 (0)