} else {
if (IS_CONST == IS_CONST || IS_CONST == IS_TMP_VAR) {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
- if (IS_CONST != IS_TMP_VAR) {
+ if (IS_CONST == IS_CONST && !Z_OPT_IMMUTABLE_P(EX(return_value))) {
zval_opt_copy_ctor(EX(return_value));
}
} else if (Z_ISREF_P(retval_ptr)) {
if (IS_CONST == IS_TMP_VAR) {
}
- } else if (!0) { /* Not a temp var */
- ZVAL_DUP(EX(return_value), retval_ptr);
} else {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
+ if (IS_CONST != IS_TMP_VAR && !Z_OPT_IMMUTABLE_P(EX(return_value))) {
+ zval_opt_copy_ctor(EX(return_value));
+ }
}
break;
}
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (!0) {
- zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ if (!Z_OPT_IMMUTABLE_P(EX_VAR(opline->result.var))) {
+ zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ }
}
CHECK_EXCEPTION();
} else {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (!0) {
- zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ if (!Z_OPT_IMMUTABLE_P(EX_VAR(opline->result.var))) {
+ zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ }
}
}
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_CONST == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_CONST == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_CONST == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_CONST == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_CONST == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
} else {
if (IS_TMP_VAR == IS_CONST || IS_TMP_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
- if (IS_TMP_VAR != IS_TMP_VAR) {
+ if (IS_TMP_VAR == IS_CONST && !Z_OPT_IMMUTABLE_P(EX(return_value))) {
zval_opt_copy_ctor(EX(return_value));
}
} else if (Z_ISREF_P(retval_ptr)) {
if (IS_TMP_VAR == IS_TMP_VAR) {
zval_dtor(free_op1.var);
}
- } else if (!1) { /* Not a temp var */
- ZVAL_DUP(EX(return_value), retval_ptr);
} else {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
+ if (IS_TMP_VAR != IS_TMP_VAR && !Z_OPT_IMMUTABLE_P(EX(return_value))) {
+ zval_opt_copy_ctor(EX(return_value));
+ }
}
break;
}
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (!1) {
- zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ if (!Z_OPT_IMMUTABLE_P(EX_VAR(opline->result.var))) {
+ zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ }
}
CHECK_EXCEPTION();
} else {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (!1) {
- zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ if (!Z_OPT_IMMUTABLE_P(EX_VAR(opline->result.var))) {
+ zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ }
}
}
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_TMP_VAR == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_TMP_VAR == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_TMP_VAR == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_TMP_VAR == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_TMP_VAR == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
} else {
if (IS_VAR == IS_CONST || IS_VAR == IS_TMP_VAR) {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
- if (IS_VAR != IS_TMP_VAR) {
+ if (IS_VAR == IS_CONST && !Z_OPT_IMMUTABLE_P(EX(return_value))) {
zval_opt_copy_ctor(EX(return_value));
}
} else if (Z_ISREF_P(retval_ptr)) {
if (IS_VAR == IS_TMP_VAR) {
zval_ptr_dtor_nogc(free_op1.var);
}
- } else if (!0) { /* Not a temp var */
- ZVAL_DUP(EX(return_value), retval_ptr);
} else {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
+ if (IS_VAR != IS_TMP_VAR && !Z_OPT_IMMUTABLE_P(EX(return_value))) {
+ zval_opt_copy_ctor(EX(return_value));
+ }
}
break;
}
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (!0) {
- zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ if (!Z_OPT_IMMUTABLE_P(EX_VAR(opline->result.var))) {
+ zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ }
}
zval_ptr_dtor_nogc(free_op1.var);
CHECK_EXCEPTION();
} else {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (!0) {
- zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ if (!Z_OPT_IMMUTABLE_P(EX_VAR(opline->result.var))) {
+ zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ }
}
}
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_VAR == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_VAR == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_VAR == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_VAR == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_VAR == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
} else {
if (IS_CV == IS_CONST || IS_CV == IS_TMP_VAR) {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
- if (IS_CV != IS_TMP_VAR) {
+ if (IS_CV == IS_CONST && !Z_OPT_IMMUTABLE_P(EX(return_value))) {
zval_opt_copy_ctor(EX(return_value));
}
} else if (Z_ISREF_P(retval_ptr)) {
if (IS_CV == IS_TMP_VAR) {
}
- } else if (!0) { /* Not a temp var */
- ZVAL_DUP(EX(return_value), retval_ptr);
} else {
ZVAL_COPY_VALUE(EX(return_value), retval_ptr);
+ if (IS_CV != IS_TMP_VAR && !Z_OPT_IMMUTABLE_P(EX(return_value))) {
+ zval_opt_copy_ctor(EX(return_value));
+ }
}
break;
}
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (!0) {
- zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ if (!Z_OPT_IMMUTABLE_P(EX_VAR(opline->result.var))) {
+ zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ }
}
CHECK_EXCEPTION();
} else {
ZVAL_COPY_VALUE(EX_VAR(opline->result.var), value);
if (!0) {
- zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ if (!Z_OPT_IMMUTABLE_P(EX_VAR(opline->result.var))) {
+ zval_opt_copy_ctor(EX_VAR(opline->result.var));
+ }
}
}
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_CV == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_CV == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_CV == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_CV == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;
ZVAL_COPY_VALUE(&new_expr, expr_ptr);
expr_ptr = &new_expr;
} else if (IS_CV == IS_CONST) {
- ZVAL_DUP(&new_expr, expr_ptr);
- expr_ptr = &new_expr;
+ if (!Z_IMMUTABLE_P(expr_ptr)) {
+ ZVAL_DUP(&new_expr, expr_ptr);
+ expr_ptr = &new_expr;
+ }
} else if (Z_ISREF_P(expr_ptr)) {
ZVAL_DUP(&new_expr, Z_REFVAL_P(expr_ptr));
expr_ptr = &new_expr;