mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
MF5.1:
- store current value of error_reporting only if it's not stored yet - reset old_error_reporting to NULL only it points to the tmp_var at current opline
This commit is contained in:
parent
be3a2c634d
commit
b97af6c1c0
2 changed files with 18 additions and 10 deletions
|
@ -3586,10 +3586,12 @@ ZEND_VM_HANDLER(79, ZEND_EXIT, CONST|TMP|VAR|UNUSED|CV, ANY)
|
|||
ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
|
||||
{
|
||||
zend_op *opline = EX(opline);
|
||||
|
||||
EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting);
|
||||
EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */
|
||||
EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var;
|
||||
|
||||
if (EX(old_error_reporting) == NULL) {
|
||||
EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting);
|
||||
EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */
|
||||
EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var;
|
||||
}
|
||||
|
||||
if (EG(error_reporting)) {
|
||||
zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
|
||||
|
@ -3615,7 +3617,9 @@ ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY)
|
|||
zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
|
||||
zendi_zval_dtor(restored_error_reporting);
|
||||
}
|
||||
EX(old_error_reporting) = NULL;
|
||||
if (EX(old_error_reporting) == &EX_T(opline->op1.u.var).tmp_var) {
|
||||
EX(old_error_reporting) = NULL;
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
|
|
|
@ -437,10 +437,12 @@ static int ZEND_NEW_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
|||
static int ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
||||
{
|
||||
zend_op *opline = EX(opline);
|
||||
|
||||
EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting);
|
||||
EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */
|
||||
EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var;
|
||||
|
||||
if (EX(old_error_reporting) == NULL) {
|
||||
EX_T(opline->result.u.var).tmp_var.value.lval = EG(error_reporting);
|
||||
EX_T(opline->result.u.var).tmp_var.type = IS_LONG; /* shouldn't be necessary */
|
||||
EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var;
|
||||
}
|
||||
|
||||
if (EG(error_reporting)) {
|
||||
zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
|
||||
|
@ -4793,7 +4795,9 @@ static int ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
|
|||
zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), Z_STRVAL(restored_error_reporting), Z_STRLEN(restored_error_reporting), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
|
||||
zendi_zval_dtor(restored_error_reporting);
|
||||
}
|
||||
EX(old_error_reporting) = NULL;
|
||||
if (EX(old_error_reporting) == &EX_T(opline->op1.u.var).tmp_var) {
|
||||
EX(old_error_reporting) = NULL;
|
||||
}
|
||||
ZEND_VM_NEXT_OPCODE();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue