cvs: ZendEngine2 / zend_reflection_api.c
| From: | Marcus Boerger | Date: | Fri, 05 Sep 2003 12:14:03 +0000 |
| Subject: | cvs: ZendEngine2 / zend_reflection_api.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-1811@lists.php.net to get a copy of this message | ||
helly Fri Sep 5 08:14:03 2003 EDT
Modified files:
/ZendEngine2 zend_reflection_api.c
Log:
Fix reflection_api::__construct() (noticed by Andrey)
Index: ZendEngine2/zend_reflection_api.c
diff -u ZendEngine2/zend_reflection_api.c:1.56 ZendEngine2/zend_reflection_api.c:1.57
--- ZendEngine2/zend_reflection_api.c:1.56 Thu Sep 4 11:57:25 2003
+++ ZendEngine2/zend_reflection_api.c Fri Sep 5 08:14:03 2003
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_reflection_api.c,v 1.56 2003/09/04 15:57:25 helly Exp $ */
+/* $Id: zend_reflection_api.c,v 1.57 2003/09/05 12:14:03 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
#include "zend_default_classes.h"
@@ -2204,6 +2204,8 @@
ZEND_METHOD(reflection_property, __construct)
{
zval *name, *class;
+ char *name_str;
+ int name_len;
zval *classname;
zval *object;
reflection_object *intern;
@@ -2213,7 +2215,7 @@
zend_property_info *property_info;
property_reference *reference;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &class, &name) ==
FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs", &class, &name_str,
&name_len) == FAILURE) {
return;
}
@@ -2250,12 +2252,12 @@
ZVAL_STRINGL(classname, ce->name, ce->name_length, 1);
zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **)
&classname, sizeof(zval *), NULL);
- convert_to_string_ex(&name);
- zval_add_ref(&name);
- zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **) name,
sizeof(zval *), NULL);
- lcname = zend_str_tolower_dup((const char *)Z_STRVAL_P(name), (int) Z_STRLEN_P(name));
+ MAKE_STD_ZVAL(name);
+ ZVAL_STRINGL(name, name_str, name_len, 1);
+ zend_hash_update(Z_OBJPROP_P(object), "name", sizeof("name"), (void **)
&name, sizeof(zval *), NULL);
+ lcname = zend_str_tolower_dup(name_str, name_len);
- if (zend_hash_find(&ce->properties_info, lcname, (int)(Z_STRLEN_P(name) + 1), (void **)
&property_info) == FAILURE) {
+ if (zend_hash_find(&ce->properties_info, lcname, name_len + 1, (void **)
&property_info) == FAILURE) {
efree(lcname);
_DO_THROW("Property does not exist");
/* returns out of this function */