@@ -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) {
@@ -10693,6 +10700,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FUNC_GET_ARGS_SPEC_CONST_UNUSE
1069310700 }
1069410701
1069510702 if (result_size) {
10703+ SAVE_OPLINE();
1069610704 uint32_t first_extra_arg = EX(func)->op_array.num_args;
1069710705
1069810706 ht = zend_new_array(result_size);
@@ -17560,13 +17568,20 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_ad
1756017568 } else if (type == BP_VAR_IS || type == BP_VAR_UNSET) {
1756117569 retval = &EG(uninitialized_zval);
1756217570 } else {
17571+ if ((IS_TMP_VAR|IS_VAR) == IS_CV) {
17572+ /* Keep name alive in case an error handler tries to free it. */
17573+ zend_string_addref(name);
17574+ }
1756317575 zend_error(E_WARNING, "Undefined %svariable $%s",
1756417576 (opline->extended_value & ZEND_FETCH_GLOBAL ? "global " : ""), ZSTR_VAL(name));
1756517577 if (type == BP_VAR_RW && !EG(exception)) {
1756617578 retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
1756717579 } else {
1756817580 retval = &EG(uninitialized_zval);
1756917581 }
17582+ if ((IS_TMP_VAR|IS_VAR) == IS_CV) {
17583+ zend_string_release(name);
17584+ }
1757017585 }
1757117586 /* GLOBAL or $$name variable may be an INDIRECT pointer to CV */
1757217587 } else if (Z_TYPE_P(retval) == IS_INDIRECT) {
@@ -36050,6 +36065,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FUNC_GET_ARGS_SPEC_UNUSED_UNUS
3605036065 }
3605136066
3605236067 if (result_size) {
36068+ SAVE_OPLINE();
3605336069 uint32_t first_extra_arg = EX(func)->op_array.num_args;
3605436070
3605536071 ht = zend_new_array(result_size);
@@ -47008,13 +47024,20 @@ static zend_never_inline ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_ad
4700847024 } else if (type == BP_VAR_IS || type == BP_VAR_UNSET) {
4700947025 retval = &EG(uninitialized_zval);
4701047026 } else {
47027+ if (IS_CV == IS_CV) {
47028+ /* Keep name alive in case an error handler tries to free it. */
47029+ zend_string_addref(name);
47030+ }
4701147031 zend_error(E_WARNING, "Undefined %svariable $%s",
4701247032 (opline->extended_value & ZEND_FETCH_GLOBAL ? "global " : ""), ZSTR_VAL(name));
4701347033 if (type == BP_VAR_RW && !EG(exception)) {
4701447034 retval = zend_hash_update(target_symbol_table, name, &EG(uninitialized_zval));
4701547035 } else {
4701647036 retval = &EG(uninitialized_zval);
4701747037 }
47038+ if (IS_CV == IS_CV) {
47039+ zend_string_release(name);
47040+ }
4701847041 }
4701947042 /* GLOBAL or $$name variable may be an INDIRECT pointer to CV */
4702047043 } else if (Z_TYPE_P(retval) == IS_INDIRECT) {
@@ -48450,6 +48473,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BIND_STATIC_SPEC_CV_UNUSED_HAN
4845048473
4845148474 variable_ptr = EX_VAR(opline->op1.var);
4845248475
48476+ SAVE_OPLINE();
48477+
4845348478 ht = ZEND_MAP_PTR_GET(EX(func)->op_array.static_variables_ptr);
4845448479 if (!ht) {
4845548480 ht = zend_array_dup(EX(func)->op_array.static_variables);
@@ -48459,7 +48484,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_BIND_STATIC_SPEC_CV_UNUSED_HAN
4845948484
4846048485 value = (zval*)((char*)ht->arData + (opline->extended_value & ~(ZEND_BIND_REF|ZEND_BIND_IMPLICIT|ZEND_BIND_EXPLICIT)));
4846148486
48462- SAVE_OPLINE();
4846348487 if (opline->extended_value & ZEND_BIND_REF) {
4846448488 if (Z_TYPE_P(value) == IS_CONSTANT_AST) {
4846548489 if (UNEXPECTED(zval_update_constant_ex(value, EX(func)->op_array.scope) != SUCCESS)) {
0 commit comments