Skip to content

Commit

Permalink
Create interned strings for internal union types
Browse files Browse the repository at this point in the history
Just like for non-union types. These may be returned to userland
via reflection, and as such need to be interned.
  • Loading branch information
nikic committed Jul 20, 2021
1 parent 9726bc6 commit bd2cd26
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -2495,8 +2495,8 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend
uint32_t j = 0;
while (true) {
const char *end = strchr(start, '|');
zend_string *str =
zend_string_init(start, end ? end - start : strlen(start), 1);
zend_string *str = zend_string_init_interned(
start, end ? end - start : strlen(start), 1);
list->types[j] = (zend_type) ZEND_TYPE_INIT_CLASS(str, 0, 0);
if (!end) {
break;
Expand Down

0 comments on commit bd2cd26

Please sign in to comment.