diff --git a/Zend/zend_attributes.c b/Zend/zend_attributes.c index cf4481e44e857..0ebe7043536c1 100644 --- a/Zend/zend_attributes.c +++ b/Zend/zend_attributes.c @@ -84,11 +84,10 @@ ZEND_API zend_attribute *zend_get_parameter_attribute_str(HashTable *attributes, return get_attribute_str(attributes, str, len, offset + 1); } -static void attribute_ptr_dtor(zval *v) /* {{{ */ +static void attribute_ptr_dtor(zval *v) { zend_attribute_free((zend_attribute *) Z_PTR_P(v)); } -/* }}} */ ZEND_API void zend_compiler_attribute_register(zend_class_entry *ce, zend_attributes_internal_validator validator) { diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index c3565bcc0a037..1b847a8d8844e 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -137,9 +137,10 @@ ZEND_API const zend_internal_function zend_pass_function = { 0, /* num_args */ 0, /* required_num_args */ NULL, /* arg_info */ + NULL, /* attributes */ ZEND_FN(pass), /* handler */ NULL, /* module */ - {NULL,NULL,NULL,NULL,NULL} /* reserved */ + {NULL,NULL,NULL,NULL} /* reserved */ }; #define FREE_VAR_PTR_AND_EXTRACT_RESULT_IF_NECESSARY(free_var) do { \ diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 6303fb6017b77..799d19ddda595 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1767,17 +1767,9 @@ ZEND_METHOD(ReflectionFunctionAbstract, getAttributes) reflection_object *intern; zend_function *fptr; - HashTable *attributes = NULL; - zend_class_entry *scope = NULL; - GET_REFLECTION_OBJECT_PTR(fptr); - if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.attributes) { - attributes = fptr->op_array.attributes; - scope = fptr->common.scope; - } - - reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, attributes, 0, scope); + reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, fptr->common.attributes, 0, fptr->common.scope); } /* }}} */ @@ -2714,15 +2706,10 @@ ZEND_METHOD(ReflectionParameter, getAttributes) reflection_object *intern; parameter_reference *param; - HashTable *attributes = NULL; - zend_class_entry *scope = NULL; - GET_REFLECTION_OBJECT_PTR(param); - if (param->fptr->type == ZEND_USER_FUNCTION && param->fptr->op_array.attributes) { - attributes = param->fptr->op_array.attributes; - scope = param->fptr->common.scope; - } + HashTable *attributes = param->fptr->common.attributes; + zend_class_entry *scope = param->fptr->common.scope; reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, attributes, param->offset + 1, scope); } @@ -3790,17 +3777,9 @@ ZEND_METHOD(ReflectionClassConstant, getAttributes) reflection_object *intern; zend_class_constant *ref; - HashTable *attributes = NULL; - zend_class_entry *scope = NULL; - GET_REFLECTION_OBJECT_PTR(ref); - if (ref->attributes) { - attributes = ref->attributes; - scope = ref->ce; - } - - reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, attributes, 0, scope); + reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, ref->attributes, 0, ref->ce); } /* }}} */ @@ -5691,17 +5670,9 @@ ZEND_METHOD(ReflectionProperty, getAttributes) reflection_object *intern; property_reference *ref; - HashTable *attributes = NULL; - zend_class_entry *scope = NULL; - GET_REFLECTION_OBJECT_PTR(ref); - if (ref->prop->attributes) { - attributes = ref->prop->attributes; - scope = ref->prop->ce; - } - - reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, attributes, 0, scope); + reflect_attributes(INTERNAL_FUNCTION_PARAM_PASSTHRU, ref->prop->attributes, 0, ref->prop->ce); } /* }}} */