diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2015-07-09 20:07:40 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2015-07-09 20:07:57 +0200 |
commit | cc876c04b420589cb1f62b650d0c0e24975dd4af (patch) | |
tree | 46e5fe6f43ff16030a746b3b7d1e83d47ed31609 /Zend/zend_compile.c | |
parent | 9591b1cc3c0a892b6febc39b80ba1f453532cb22 (diff) | |
download | php-git-cc876c04b420589cb1f62b650d0c0e24975dd4af.tar.gz |
Fix too early terminated temporary range with break/cont/goto
I have no crashing or leaking reproduce script, only valgrind invalid reads for that one; hence no phpt here
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r-- | Zend/zend_compile.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 9cdb5ffd03..4f21769e12 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3482,7 +3482,7 @@ void zend_compile_return(zend_ast *ast) /* {{{ */ zend_emit_return_type_check(expr_ast ? &expr_node : NULL, CG(active_op_array)->arg_info - 1); } - zend_free_foreach_and_switch_variables(ZEND_FREE_ON_RETURN); + zend_free_foreach_and_switch_variables(ZEND_FREE_ON_JUMP); if (CG(context).in_finally) { opline = zend_emit_op(NULL, ZEND_DISCARD_EXCEPTION, NULL, NULL); @@ -3567,7 +3567,7 @@ void zend_compile_break_continue(zend_ast *ast) /* {{{ */ } if (nest_level > 1) { - generate_free_loop_var(&CG(context).brk_cont_array[array_offset].loop_var); + generate_free_loop_var_ex(&CG(context).brk_cont_array[array_offset].loop_var, ZEND_FREE_ON_JUMP); } array_offset = CG(context).brk_cont_array[array_offset].parent; @@ -3637,7 +3637,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, znode *label_node, zend_op if (pass2_opline) { free_vars++; } else { - generate_free_loop_var(&CG(context).brk_cont_array[current].loop_var); + generate_free_loop_var_ex(&CG(context).brk_cont_array[current].loop_var, ZEND_FREE_ON_JUMP); } } current = CG(context).brk_cont_array[current].parent; |