]> granicus.if.org Git - php/commitdiff
MF5.1:
authorAntony Dovgal <tony2001@php.net>
Fri, 23 Sep 2005 09:38:37 +0000 (09:38 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 23 Sep 2005 09:38:37 +0000 (09:38 +0000)
- 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

Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index bdf22f717e425c82dc544179e9f904329d7e45fa..7b51bf983324222b7f3f76f5fbadcd19b202d16f 100644 (file)
@@ -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();
 }
 
index 7db81b0d53ed7715568d55780da2f2f5fc505e19..1e4e82bf77ba6094efb16e5e4f33f9f5f659be9d 100644 (file)
@@ -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();
 }