#23803 [Opn->Fbk]: disp_invokeex won't work with multiple args.
| From: | sniper@php.net | Date: | Mon, 26 May 2003 03:00:12 +0000 |
| Subject: | #23803 [Opn->Fbk]: disp_invokeex won't work with multiple args. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-40416@lists.php.net to get a copy of this message | ||
ID: 23803
Updated by: sniper@php.net
Reported By: eddie at omegaware dot com
-Status: Open
+Status: Feedback
Bug Type: COM related
PHP Version: 4.3.1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2003-05-25 14:46:08] eddie at omegaware dot com
dispatch.c line 292 in function
static HRESULT STDMETHODCALLTYPE disp_invokdeex
will not give the expected results..
I found this while writing my own function to use call_user_function_ex
to call a function with params.. And was searching through the PHP code
to see how it was called elsewhere.. and this function is doing it the
same way I was doing it.. which doesn't work..
in line 270 a zval *zarg is allocated. then it is initialized once for
each argument.. the argument is assigned to the zarg then the address
of the zarg is stored in the **params[] array.
The problem is the *zarg has the same address for each iteration.. so
every params[i]=&zarg will assign the same address for every parameter
"i". so all the paramters will be the last parameter passed..
a zval ** needs to be allocated instead of a zval *.. so the address
is different for each parameter..
since I capped the maximum number of params I just allocate a zval
*zarg[4]; but a more dynamic solution would be better.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23803&edit=1