Skip to content

Commit 7119f6c

Browse files
committed
fix attributes
1 parent 2767025 commit 7119f6c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Zend/zend_attributes.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,13 @@ ZEND_API zend_internal_attribute *zend_internal_attribute_register(zend_class_en
486486

487487
ZEND_API zend_internal_attribute *zend_internal_attribute_get(zend_string *lcname)
488488
{
489+
const char *inner = strrchr(ZSTR_VAL(lcname), '|');
490+
if (inner) {
491+
lcname = zend_string_init(inner + 1, strlen(inner) - 1, 0);
492+
zend_internal_attribute *attr = zend_internal_attribute_get(lcname);
493+
zend_string_release(lcname);
494+
return attr;
495+
}
489496
return zend_hash_find_ptr(&internal_attributes, lcname);
490497
}
491498

Zend/zend_compile.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,6 +1443,12 @@ static zend_string *resolve_class_name(zend_string *name, zend_class_entry *scop
14431443
}
14441444
}
14451445

1446+
char *nested = strrchr(ZSTR_VAL(name), '|');
1447+
if (nested) {
1448+
/* The original scope is encoded in the name. */
1449+
return zend_string_init(nested + 1, ZSTR_LEN(name) - (nested - ZSTR_VAL(name)) - 1, 0);
1450+
}
1451+
14461452
/* The resolved name for anonymous classes contains null bytes. Cut off everything after the
14471453
* null byte here, to avoid larger parts of the type being omitted by printing code later. */
14481454
size_t len = strlen(ZSTR_VAL(name));

0 commit comments

Comments
 (0)