[PATCH] extend zend_parse_parameters() functionality (2nd attempt)
| From: | fuhs at purdue dot edu | Date: | Fri, 27 Jun 2003 18:18:32 +0000 |
| Subject: | [PATCH] extend zend_parse_parameters() functionality (2nd attempt) | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-2903@lists.php.net to get a copy of this message | ||
Hello,
I propose that a new type, 'Z', be added in order to allow the extension coders
access to the zval** which was available with the now deprecated
zend_get_parameters().
I came to this conclusion after tracing some segfaults to a section of code
similar to this:
zval *zend_value;
if(zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &zend_value) ==
FAILURE)
return;
convert_to_array_ex(&zend_value);
I realized after sifting through the Zend code that the proper handling of zval*
types is just as important as that of the zval's. This modification will
give extension programmers access to legitimate zval*'s and their corresponding
zval.
Zend/zend_API.c RELEASE ver 4.3.1
425c425,434
<
---
> case 'Z':
> {
> zval ***p=va_arg(*va, zval ***);
> if(Z_TYPE_PP(arg) == IS_NULL && return_null){
> *p = NULL;
> } else {
> *p = arg;
> }
> }
> break;
474c483
< case 'z':
---
> case 'z': case 'Z':
Josh