ZVAL_NEW_REF(&fci->params[i], &tmp);
Z_ADDREF(fci->params[i]);
} else if (!Z_ISREF(fci->params[i])) {
- if (Z_REFCOUNTED(fci->params[i])) {
- Z_ADDREF(fci->params[i]);
- }
ZVAL_NEW_REF(&fci->params[i], &fci->params[i]);
+ Z_ADDREF(fci->params[i]);
} else if (Z_REFCOUNTED(fci->params[i])) {
Z_ADDREF(fci->params[i]);
}
zend_error(E_CORE_ERROR, "Couldn't execute method %s%s%s", obj_ce ? obj_ce->name->val : "", obj_ce ? "::" : "", function_name);
}
}
+ /* copy arguments back, they might be changed by references */
+ if (param_count > 0) {
+ ZVAL_COPY_VALUE(arg1, ¶ms[0]);
+ }
+ if (param_count > 1) {
+ ZVAL_COPY_VALUE(arg2, ¶ms[1]);
+ }
if (!retval_ptr) {
zval_ptr_dtor(&retval);
return NULL;
case IS_REFERENCE: {
zend_reference *ref = (zend_reference*)p;
if (--ref->gc.refcount == 0) {
- zval_dtor(&ref->val);
+ zval_ptr_dtor(&ref->val);
goto gc_exit;
}
goto exit;
case IS_REFERENCE: {
zend_reference *ref = (zend_reference*)p;
- zval_dtor(&ref->val);
+ zval_ptr_dtor(&ref->val);
goto gc_exit;
}
default: