Skip to content

Commit

Permalink
Fixed bug #76046
Browse files Browse the repository at this point in the history
Place FE_FREE on start line of foreach, instead of whatever random
line number might be in CG(zend_lineno) at the time.
  • Loading branch information
nikic committed Nov 27, 2018
1 parent 9ec519e commit d6595f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_compile.c
Expand Up @@ -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);
}
/* }}} */
Expand Down

0 comments on commit d6595f2

Please sign in to comment.