From 75041379a6e73b22c094c3c9c7878a1c4e439725 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 6 Nov 2014 14:50:03 +0300 Subject: Improved object property access. --- ext/reflection/php_reflection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/reflection/php_reflection.c') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 3d44c35b62..b972c2899c 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3363,7 +3363,7 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value if (statics && (prop_info->flags & ZEND_ACC_STATIC) != 0) { prop = &ce->default_static_members_table[prop_info->offset]; } else if (!statics && (prop_info->flags & ZEND_ACC_STATIC) == 0) { - prop = &ce->default_properties_table[prop_info->offset]; + prop = &ce->default_properties_table[OBJ_PROP_TO_NUM(prop_info->offset)]; } } if (!prop) { -- cgit v1.2.1 From 3b4a6dc11496dbdf22a5a83966f963107d20234e Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Fri, 14 Nov 2014 09:46:06 +0100 Subject: removed useless check the offset member is an unsigned --- ext/reflection/php_reflection.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'ext/reflection/php_reflection.c') diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index b972c2899c..e9c59ea86e 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -3359,12 +3359,10 @@ static void add_class_vars(zend_class_entry *ce, int statics, zval *return_value continue; } prop = NULL; - if (prop_info->offset >= 0) { - if (statics && (prop_info->flags & ZEND_ACC_STATIC) != 0) { - prop = &ce->default_static_members_table[prop_info->offset]; - } else if (!statics && (prop_info->flags & ZEND_ACC_STATIC) == 0) { - prop = &ce->default_properties_table[OBJ_PROP_TO_NUM(prop_info->offset)]; - } + if (statics && (prop_info->flags & ZEND_ACC_STATIC) != 0) { + prop = &ce->default_static_members_table[prop_info->offset]; + } else if (!statics && (prop_info->flags & ZEND_ACC_STATIC) == 0) { + prop = &ce->default_properties_table[OBJ_PROP_TO_NUM(prop_info->offset)]; } if (!prop) { continue; -- cgit v1.2.1