Skip to content
Closed
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
1 change: 1 addition & 0 deletions Zend/zend_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ struct _zend_compiler_globals {
bool multibyte;
bool detect_unicode;
bool encoding_declared;
bool interned_strings_initialized;

zend_ast *ast;
zend_arena *ast_arena;
Expand Down
4 changes: 4 additions & 0 deletions Zend/zend_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ static zend_string* ZEND_FASTCALL zend_new_interned_string_request(zend_string *
return ret;
}

if (!CG(interned_strings_initialized)) {
zend_interned_strings_activate();
}
ret = zend_interned_string_ht_lookup(str, &CG(interned_strings));
if (ret) {
zend_string_release(str);
Expand Down Expand Up @@ -339,6 +342,7 @@ static zend_string* ZEND_FASTCALL zend_string_init_existing_interned_request(con
ZEND_API void zend_interned_strings_activate(void)
{
zend_init_interned_strings_ht(&CG(interned_strings), 0);
CG(interned_strings_initialized) = true;
}

ZEND_API void zend_interned_strings_deactivate(void)
Expand Down