@@ -9755,13 +9755,20 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_ad
97559755 } else if (type == BP_VAR_IS || type == BP_VAR_UNSET) {
97569756 retval = &EG(uninitialized_zval);
97579757 } else {
9758+ if (IS_CONST == IS_CV) {
9759+ /* Keep name alive in case an error handler tries to free it. */
9760+ zend_string_addref(name);
9761+ }
97589762 zend_error(E_WARNING, "Undefined %svariable $%s",
97599763 (opline->extended_value & ZEND_FETCH_GLOBAL ? "global " : ""), ZSTR_VAL(name));
97609764 if (type == BP_VAR_RW && !EG(exception)) {
97619765 retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
97629766 } else {
97639767 retval = &EG(uninitialized_zval);
97649768 }
9769+ if (IS_CONST == IS_CV) {
9770+ zend_string_release(name);
9771+ }
97659772 }
97669773 /* GLOBAL or $$name variable may be an INDIRECT pointer to CV */
97679774 } else if (Z_TYPE_P(retval) == IS_INDIRECT) {
@@ -17560,13 +17567,20 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_ad
1756017567 } else if (type == BP_VAR_IS || type == BP_VAR_UNSET) {
1756117568 retval = &EG(uninitialized_zval);
1756217569 } else {
17570+ if ((IS_TMP_VAR|IS_VAR) == IS_CV) {
17571+ /* Keep name alive in case an error handler tries to free it. */
17572+ zend_string_addref(name);
17573+ }
1756317574 zend_error(E_WARNING, "Undefined %svariable $%s",
1756417575 (opline->extended_value & ZEND_FETCH_GLOBAL ? "global " : ""), ZSTR_VAL(name));
1756517576 if (type == BP_VAR_RW && !EG(exception)) {
1756617577 retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
1756717578 } else {
1756817579 retval = &EG(uninitialized_zval);
1756917580 }
17581+ if ((IS_TMP_VAR|IS_VAR) == IS_CV) {
17582+ zend_string_release(name);
17583+ }
1757017584 }
1757117585 /* GLOBAL or $$name variable may be an INDIRECT pointer to CV */
1757217586 } else if (Z_TYPE_P(retval) == IS_INDIRECT) {
@@ -47008,13 +47022,20 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_ad
4700847022 } else if (type == BP_VAR_IS || type == BP_VAR_UNSET) {
4700947023 retval = &EG(uninitialized_zval);
4701047024 } else {
47025+ if (IS_CV == IS_CV) {
47026+ /* Keep name alive in case an error handler tries to free it. */
47027+ zend_string_addref(name);
47028+ }
4701147029 zend_error(E_WARNING, "Undefined %svariable $%s",
4701247030 (opline->extended_value & ZEND_FETCH_GLOBAL ? "global " : ""), ZSTR_VAL(name));
4701347031 if (type == BP_VAR_RW && !EG(exception)) {
4701447032 retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
4701547033 } else {
4701647034 retval = &EG(uninitialized_zval);
4701747035 }
47036+ if (IS_CV == IS_CV) {
47037+ zend_string_release(name);
47038+ }
4701847039 }
4701947040 /* GLOBAL or $$name variable may be an INDIRECT pointer to CV */
4702047041 } else if (Z_TYPE_P(retval) == IS_INDIRECT) {
0 commit comments