Skip to content

Commit fbd6799

Browse files
committed
Propagate VALID UTF8 flag when interning string via Opcache
1 parent f6dbd08 commit fbd6799

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/opcache/ZendAccelerator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ zend_string* ZEND_FASTCALL accel_new_interned_string(zend_string *str)
549549
STRTAB_COLLISION(s) = *hash_slot;
550550
*hash_slot = STRTAB_STR_TO_POS(&ZCSG(interned_strings), s);
551551
GC_SET_REFCOUNT(s, 2);
552-
GC_TYPE_INFO(s) = GC_STRING | ((IS_STR_INTERNED | IS_STR_PERMANENT) << GC_FLAGS_SHIFT);
552+
GC_TYPE_INFO(s) = GC_STRING | ((IS_STR_INTERNED | IS_STR_PERMANENT) << GC_FLAGS_SHIFT)| (ZSTR_IS_VALID_UTF8(str) ? IS_STR_VALID_UTF8 : 0);
553553
ZSTR_H(s) = h;
554554
ZSTR_LEN(s) = ZSTR_LEN(str);
555555
memcpy(ZSTR_VAL(s), ZSTR_VAL(str), ZSTR_LEN(s) + 1);

0 commit comments

Comments
 (0)