diff options
| author | Anatol Belski <ab@php.net> | 2016-08-25 12:14:54 +0200 |
|---|---|---|
| committer | Anatol Belski <ab@php.net> | 2016-08-25 12:14:54 +0200 |
| commit | 36f2c8249b5d37d5923621a7d202538d46a5d30d (patch) | |
| tree | 5e1e2902478a9c23be449ce5e436efc6140d3fb6 /ext | |
| parent | aefd3e4d8be9362a5af120b27b34a1ed1d0379d1 (diff) | |
| parent | cd5cab62884dfaf99e625718dd9b85c6818081c4 (diff) | |
| download | php-git-36f2c8249b5d37d5923621a7d202538d46a5d30d.tar.gz | |
Merge branch 'PHP-7.1'
* PHP-7.1:
update NEWS
Fixed bug #72922 COM called from PHP does not return out parameters
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/com_dotnet/com_com.c | 11 | ||||
| -rw-r--r-- | ext/com_dotnet/com_handlers.c | 3 |
2 files changed, 8 insertions, 6 deletions
diff --git a/ext/com_dotnet/com_com.c b/ext/com_dotnet/com_com.c index bb87d8fb2f..ec1c72191c 100644 --- a/ext/com_dotnet/com_com.c +++ b/ext/com_dotnet/com_com.c @@ -553,7 +553,10 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function * for (i = 0, j = 0; i < nargs; i++) { /* if this was byref, update the zval */ if (f->arg_info[nargs - i - 1].pass_by_reference) { - SEPARATE_ZVAL_IF_NOT_REF(&args[nargs - i - 1]); + zval *arg = &args[nargs - i - 1]; + + ZVAL_DEREF(arg); + SEPARATE_ZVAL_NOREF(arg); /* if the variant is pointing at the byref_vals, we need to map * the pointee value as a zval; otherwise, the value is pointing @@ -561,14 +564,12 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, zend_internal_function * if (V_VT(&vargs[i]) & VT_BYREF) { if (vargs[i].byref == &V_UINT(&byref_vals[j])) { /* copy that value */ - php_com_zval_from_variant(&args[nargs - i - 1], &byref_vals[j], - obj->code_page); + php_com_zval_from_variant(arg, &byref_vals[j], obj->code_page); } } else { /* not sure if this can ever happen; the variant we marked as BYREF * is no longer BYREF - copy its value */ - php_com_zval_from_variant(&args[nargs - i - 1], &vargs[i], - obj->code_page); + php_com_zval_from_variant(arg, &vargs[i], obj->code_page); } VariantClear(&byref_vals[j]); j++; diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 122c618426..415fcb92f4 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -305,7 +305,8 @@ static union _zend_function *com_method_get(zend_object **object_ptr, zend_strin for (i = 0; i < bindptr.lpfuncdesc->cParams; i++) { f.arg_info[i].allow_null = 1; if (bindptr.lpfuncdesc->lprgelemdescParam[i].paramdesc.wParamFlags & PARAMFLAG_FOUT) { - f.arg_info[i].pass_by_reference = 1; + f.arg_info[i].pass_by_reference = ZEND_SEND_BY_REF; + ZEND_SET_ARG_FLAG(fptr, i + 1, ZEND_SEND_BY_REF); } } |
