Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Zend/zend_attributes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
3 changes: 2 additions & 1 deletion Zend/zend_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 { \
Expand Down
39 changes: 5 additions & 34 deletions ext/reflection/php_reflection.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
/* }}} */

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
/* }}} */

Expand Down Expand Up @@ -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);
}
/* }}} */

Expand Down