cvs: ZendEngine2 / zend_reflection_api.c
| From: | Marcus Boerger | Date: | Tue, 15 Jun 2004 20:39:49 +0000 |
| Subject: | cvs: ZendEngine2 / zend_reflection_api.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-2703@lists.php.net to get a copy of this message | ||
helly Tue Jun 15 16:39:49 2004 EDT
Modified files:
/ZendEngine2 zend_reflection_api.c
Log:
#28789: ReflectionProperty getValue() fails on public static members
http://cvs.php.net/diff.php/ZendEngine2/zend_reflection_api.c?r1=1.109&r2=1.110&ty=u
Index: ZendEngine2/zend_reflection_api.c
diff -u ZendEngine2/zend_reflection_api.c:1.109 ZendEngine2/zend_reflection_api.c:1.110
--- ZendEngine2/zend_reflection_api.c:1.109 Thu Jun 10 08:11:16 2004
+++ ZendEngine2/zend_reflection_api.c Tue Jun 15 16:39:49 2004
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_reflection_api.c,v 1.109 2004/06/10 12:11:16 helly Exp $ */
+/* $Id: zend_reflection_api.c,v 1.110 2004/06/15 20:39:49 helly Exp $ */
#include "zend.h"
#include "zend_API.h"
#include "zend_exceptions.h"
@@ -2873,7 +2873,7 @@
METHOD_NOTSTATIC;
GET_REFLECTION_OBJECT_PTR(ref);
- if (ref->prop->flags & ~ZEND_ACC_PUBLIC) {
+ if (!(ref->prop->flags & ZEND_ACC_PUBLIC)) {
_DO_THROW("Cannot access non-public member");
/* Returns from this function */
}
@@ -2882,9 +2882,16 @@
return;
}
- if (zend_hash_quick_find(Z_OBJPROP_P(object), ref->prop->name, ref->prop->name_length
+ 1, ref->prop->h, (void **) &member) == FAILURE) {
- zend_error(E_ERROR, "Internal error: Could not find the property %s",
ref->prop->name);
- /* Bails out */
+ if ((ref->prop->flags & ZEND_ACC_STATIC)) {
+ if (zend_hash_quick_find(Z_OBJCE_P(object)->static_members, ref->prop->name,
ref->prop->name_length + 1, ref->prop->h, (void **) &member) == FAILURE) {
+ zend_error(E_ERROR, "Internal error: Could not find the property %s",
ref->prop->name);
+ /* Bails out */
+ }
+ } else {
+ if (zend_hash_quick_find(Z_OBJPROP_P(object), ref->prop->name, ref->prop->name_length
+ 1, ref->prop->h, (void **) &member) == FAILURE) {
+ zend_error(E_ERROR, "Internal error: Could not find the property %s",
ref->prop->name);
+ /* Bails out */
+ }
}
*return_value= **member;