summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-11-27 19:44:45 +0100
committerNikita Popov <nikita.ppv@gmail.com>2018-11-27 19:44:45 +0100
commit12e88781e146cfaffbeb01b09d8d5092380e9413 (patch)
tree5303f9fd627bdefa83083bd8cc9ff4df5cd20a76
parentd78211aec072ed482a444188f743cb341a24afe1 (diff)
parentb565c85b9e166cbbc024ce279986b18e96048042 (diff)
downloadphp-git-12e88781e146cfaffbeb01b09d8d5092380e9413.tar.gz
Merge branch 'PHP-7.2' into PHP-7.3
-rw-r--r--Zend/zend_compile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index ad6dba2ff4..6e387eabad 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -4845,6 +4845,10 @@ void zend_compile_foreach(zend_ast *ast) /* {{{ */
zend_compile_stmt(stmt_ast);
+ /* Place JMP and FE_FREE on the line where foreach starts. It would be
+ * better to use the end line, but this information is not available
+ * currently. */
+ CG(zend_lineno) = ast->lineno;
zend_emit_jump(opnum_fetch);
opline = &CG(active_op_array)->opcodes[opnum_reset];
@@ -4855,7 +4859,6 @@ 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);
}
/* }}} */