diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-09-03 15:17:50 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-09-03 15:17:50 +0400 |
commit | 9a958a086d9718b8b88d742e0e836fef6d35adf2 (patch) | |
tree | 945b07549917ec05bca927d9ca4c3f53a196ca4a /Zend/zend_compile.c | |
parent | d1b0066df756396ade428569debe3816fc196683 (diff) | |
download | php-git-9a958a086d9718b8b88d742e0e836fef6d35adf2.tar.gz |
Simplify BEGIN_SILENCE/END_SILENCE to not modify ini entry value back and force
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r-- | Zend/zend_compile.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 4fbdff3059..a8ee529a80 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -7096,8 +7096,13 @@ void zend_compile_silence(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ { zend_ast *expr_ast = ast->child[0]; znode silence_node; + uint32_t opline_num; + zend_op *begin_silence, *end_silence; - zend_emit_op_tmp(&silence_node, ZEND_BEGIN_SILENCE, NULL, NULL TSRMLS_CC); + opline_num = get_next_op_number(CG(active_op_array)); + begin_silence = zend_emit_op_tmp(&silence_node, ZEND_BEGIN_SILENCE, NULL, NULL TSRMLS_CC); + /* pair BEGIN_SILENCE and END_SILENCE opcodes */ + begin_silence->op2.num = opline_num; if (expr_ast->kind == ZEND_AST_VAR) { /* For @$var we need to force a FETCH instruction, otherwise the CV access will @@ -7107,7 +7112,9 @@ void zend_compile_silence(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */ zend_compile_expr(result, expr_ast TSRMLS_CC); } - zend_emit_op(NULL, ZEND_END_SILENCE, &silence_node, NULL TSRMLS_CC); + end_silence = zend_emit_op(NULL, ZEND_END_SILENCE, &silence_node, NULL TSRMLS_CC); + /* pair BEGIN_SILENCE and END_SILENCE opcodes */ + end_silence->op2.num = opline_num; } /* }}} */ |