From: Dmitry Stogov Date: Tue, 2 Sep 2014 22:38:04 +0000 (+0400) Subject: Revert "Fixed memory leaks" X-Git-Tag: PRE_PHP7_REMOVALS~138 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0f0211b1ae695809f72a8a241649cda6ecd38bb;p=php Revert "Fixed memory leaks" This reverts commit 0940e54ffc73fc470772228f219750727375c384. --- diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 69226bafe6..a1fbba752e 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -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)); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 14a587133e..2118904616 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -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));