]> granicus.if.org Git - php/commitdiff
Revert "Fixed memory leaks"
authorDmitry Stogov <dmitry@zend.com>
Tue, 2 Sep 2014 22:38:04 +0000 (02:38 +0400)
committerDmitry Stogov <dmitry@zend.com>
Tue, 2 Sep 2014 22:38:04 +0000 (02:38 +0400)
This reverts commit 0940e54ffc73fc470772228f219750727375c384.

Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 69226bafe6bb2a874a5c2d84bebd55f9528ef995..a1fbba752e46b5618ef3881ed95a1fa44b7e6a0d 100644 (file)
@@ -5061,6 +5061,9 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
                        }
                }
                ZVAL_NEW_STR(EX_VAR(opline->result.var), EG(error_reporting_ini_entry)->value);
+               if (EG(error_reporting_ini_entry)->value) {
+                       zend_string_addref(EG(error_reporting_ini_entry)->value);
+               }
                if (Z_TYPE(EX(old_error_reporting)) == IS_UNDEF) {
                        ZVAL_NEW_STR(&EX(old_error_reporting), EG(error_reporting_ini_entry)->value);
                }
@@ -5076,6 +5079,8 @@ ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
                                        EG(error_reporting_ini_entry)->orig_modifiable = EG(error_reporting_ini_entry)->modifiable;
                                        EG(error_reporting_ini_entry)->modified = 1;
                                }
+                       } else if (EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value) {
+                               zend_string_release(EG(error_reporting_ini_entry)->value);
                        }
                        if (CG(one_char_string)['0']) {
                                EG(error_reporting_ini_entry)->value = CG(one_char_string)['0'];
@@ -5103,8 +5108,7 @@ ZEND_VM_HANDLER(58, ZEND_END_SILENCE, TMP, ANY)
                EG(error_reporting) = EX_VAR(opline->op1.var)->u2.error_reporting;
                if (EXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) == IS_STRING)) {
                        if (EXPECTED(EG(error_reporting_ini_entry)->modified &&
-                           EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value) &&
-                           EG(error_reporting_ini_entry)->value != Z_STR_P(EX_VAR(opline->op1.var))) {
+                           EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value)) {
                                zend_string_release(EG(error_reporting_ini_entry)->value);
                        }
                        EG(error_reporting_ini_entry)->value = Z_STR_P(EX_VAR(opline->op1.var));
index 14a587133ef53165ca7606788bd43de71d33b913..211890461614b34dcc792a0d8cb59c22f5631433 100644 (file)
@@ -1121,6 +1121,9 @@ static int ZEND_FASTCALL  ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
                        }
                }
                ZVAL_NEW_STR(EX_VAR(opline->result.var), EG(error_reporting_ini_entry)->value);
+               if (EG(error_reporting_ini_entry)->value) {
+                       zend_string_addref(EG(error_reporting_ini_entry)->value);
+               }
                if (Z_TYPE(EX(old_error_reporting)) == IS_UNDEF) {
                        ZVAL_NEW_STR(&EX(old_error_reporting), EG(error_reporting_ini_entry)->value);
                }
@@ -1136,6 +1139,8 @@ static int ZEND_FASTCALL  ZEND_BEGIN_SILENCE_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
                                        EG(error_reporting_ini_entry)->orig_modifiable = EG(error_reporting_ini_entry)->modifiable;
                                        EG(error_reporting_ini_entry)->modified = 1;
                                }
+                       } else if (EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value) {
+                               zend_string_release(EG(error_reporting_ini_entry)->value);
                        }
                        if (CG(one_char_string)['0']) {
                                EG(error_reporting_ini_entry)->value = CG(one_char_string)['0'];
@@ -10038,8 +10043,7 @@ static int ZEND_FASTCALL  ZEND_END_SILENCE_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
                EG(error_reporting) = EX_VAR(opline->op1.var)->u2.error_reporting;
                if (EXPECTED(Z_TYPE_P(EX_VAR(opline->op1.var)) == IS_STRING)) {
                        if (EXPECTED(EG(error_reporting_ini_entry)->modified &&
-                           EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value) &&
-                           EG(error_reporting_ini_entry)->value != Z_STR_P(EX_VAR(opline->op1.var))) {
+                           EG(error_reporting_ini_entry)->value != EG(error_reporting_ini_entry)->orig_value)) {
                                zend_string_release(EG(error_reporting_ini_entry)->value);
                        }
                        EG(error_reporting_ini_entry)->value = Z_STR_P(EX_VAR(opline->op1.var));