Remove useless parts of EX(old_error_reporting)

This commit is contained in:
Dmitry Stogov 2014-10-07 17:54:24 +04:00
parent 33e137d409
commit 67be34ec95
5 changed files with 21 additions and 23 deletions

View File

@ -370,7 +370,8 @@ struct _zend_execute_data {
zend_array *symbol_table;
const zend_op *fast_ret; /* used by FAST_CALL/FAST_RET (finally keyword) */
zend_object *delayed_exception;
zval old_error_reporting;
uint32_t silence_op_num;
uint32_t old_error_reporting;
};
#define VM_FRAME_KIND_MASK 0x000000ff

View File

@ -1433,7 +1433,7 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
EX(return_value) = return_value;
EX(scope) = EG(scope);
EX(delayed_exception) = NULL;
ZVAL_UNDEF(&EX(old_error_reporting));
EX(silence_op_num) = -1;
/* Handle arguments */
first_extra_arg = op_array->num_args;
@ -1500,7 +1500,7 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu
EX(return_value) = return_value;
EX(scope) = EG(scope);
EX(delayed_exception) = NULL;
ZVAL_UNDEF(&EX(old_error_reporting));
EX(silence_op_num) = -1;
zend_attach_symbol_table(execute_data);
@ -1527,7 +1527,7 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da
EX(return_value) = return_value;
EX(scope) = EG(scope);
EX(delayed_exception) = NULL;
ZVAL_UNDEF(&EX(old_error_reporting));
EX(silence_op_num) = -1;
if (UNEXPECTED(EX(symbol_table) != NULL)) {
zend_attach_symbol_table(execute_data);

View File

@ -141,7 +141,6 @@ struct _zval_struct {
uint32_t next; /* hash collision chain */
uint32_t cache_slot; /* literal cache slot */
uint32_t lineno; /* line number (for ast nodes) */
uint32_t silence_num; /* BEGIN_SILENCE op number */
} u2;
};

View File

@ -5097,9 +5097,9 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
SAVE_OPLINE();
ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting));
if (Z_TYPE(EX(old_error_reporting)) == IS_UNDEF) {
ZVAL_LONG(&EX(old_error_reporting), EG(error_reporting));
EX(old_error_reporting).u2.silence_num = opline->op2.num;
if (EX(silence_op_num) == -1) {
EX(silence_op_num) = opline->op2.num;
EX(old_error_reporting) = EG(error_reporting);
}
if (EG(error_reporting)) {
@ -5138,9 +5138,8 @@ ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY)
if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(opline->op1.var)) != 0) {
EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var));
}
if (Z_TYPE(EX(old_error_reporting)) != IS_UNDEF &&
EX(old_error_reporting).u2.silence_num == opline->op2.num) {
ZVAL_UNDEF(&EX(old_error_reporting));
if (EX(silence_op_num) == opline->op2.num) {
EX(silence_op_num) = -1;
}
ZEND_VM_NEXT_OPCODE();
}
@ -5495,10 +5494,10 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
}
/* restore previous error_reporting value */
if (!EG(error_reporting) && Z_TYPE(EX(old_error_reporting)) != IS_UNDEF && Z_LVAL(EX(old_error_reporting)) != 0) {
EG(error_reporting) = Z_LVAL(EX(old_error_reporting));
if (!EG(error_reporting) && EX(silence_op_num) != -1 && EX(old_error_reporting) != 0) {
EG(error_reporting) = EX(old_error_reporting);
}
ZVAL_UNDEF(&EX(old_error_reporting));
EX(silence_op_num) = -1;
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
if (EX(delayed_exception)) {

View File

@ -1080,9 +1080,9 @@ static int ZEND_FASTCALL ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
SAVE_OPLINE();
ZVAL_LONG(EX_VAR(opline->result.var), EG(error_reporting));
if (Z_TYPE(EX(old_error_reporting)) == IS_UNDEF) {
ZVAL_LONG(&EX(old_error_reporting), EG(error_reporting));
EX(old_error_reporting).u2.silence_num = opline->op2.num;
if (EX(silence_op_num) == -1) {
EX(silence_op_num) = opline->op2.num;
EX(old_error_reporting) = EG(error_reporting);
}
if (EG(error_reporting)) {
@ -1321,10 +1321,10 @@ static int ZEND_FASTCALL ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
}
/* restore previous error_reporting value */
if (!EG(error_reporting) && Z_TYPE(EX(old_error_reporting)) != IS_UNDEF && Z_LVAL(EX(old_error_reporting)) != 0) {
EG(error_reporting) = Z_LVAL(EX(old_error_reporting));
if (!EG(error_reporting) && EX(silence_op_num) != -1 && EX(old_error_reporting) != 0) {
EG(error_reporting) = EX(old_error_reporting);
}
ZVAL_UNDEF(&EX(old_error_reporting));
EX(silence_op_num) = -1;
if (finally_op_num && (!catch_op_num || catch_op_num >= finally_op_num)) {
if (EX(delayed_exception)) {
@ -10106,9 +10106,8 @@ static int ZEND_FASTCALL ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
if (!EG(error_reporting) && Z_LVAL_P(EX_VAR(opline->op1.var)) != 0) {
EG(error_reporting) = Z_LVAL_P(EX_VAR(opline->op1.var));
}
if (Z_TYPE(EX(old_error_reporting)) != IS_UNDEF &&
EX(old_error_reporting).u2.silence_num == opline->op2.num) {
ZVAL_UNDEF(&EX(old_error_reporting));
if (EX(silence_op_num) == opline->op2.num) {
EX(silence_op_num) = -1;
}
ZEND_VM_NEXT_OPCODE();
}