avoid COW violation
authorMichael Wallner <mike@php.net>
Tue, 31 Jan 2017 15:47:52 +0000 (16:47 +0100)
committerMichael Wallner <mike@php.net>
Tue, 31 Jan 2017 15:54:35 +0000 (16:54 +0100)
src/call.c

index 46a1dde419cf32876cb591e3aeb03dcdf8f49dff..3b477943d4fa06b8380bed164da8c82a75e318d1 100644 (file)
@@ -187,6 +187,7 @@ zval *psi_call_frame_sub_argument(struct psi_call_frame *frame,
        if (!inner_zval) {
                zval empty_zval;
 
+               SEPARATE_ZVAL(outer_zval);
                ZVAL_NULL(&empty_zval);
                inner_zval = zend_symtable_str_update(Z_ARRVAL_P(outer_zval),
                                &inner_var->name[1], strlen(&inner_var->name[1]),
@@ -282,9 +283,9 @@ ZEND_RESULT_CODE psi_call_frame_parse_args(struct psi_call_frame *frame,
                        Z_PARAM_ARRAY_EX(tmp, _optional || iarg->var->reference,
                                        iarg->var->reference);
                } else if (PSI_T_OBJECT == iarg->type->type) {
-                       Z_PARAM_PROLOGUE(0);
+                       Z_PARAM_PROLOGUE(iarg->var->reference);
                } else if (PSI_T_MIXED == iarg->type->type) {
-                       Z_PARAM_PROLOGUE(0);
+                       Z_PARAM_PROLOGUE(iarg->var->reference);
                } else if (PSI_T_CALLABLE == iarg->type->type) {
                        zend_fcall_info fci;
                        zend_fcall_info_cache fcc;