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);
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();
}
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);
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();
}