From 18b61586f21dc0bda5a37f0a5bcc2a665d7c29ac Mon Sep 17 00:00:00 2001 From: Weilin Du Date: Thu, 30 Jul 2026 20:50:49 +0800 Subject: [PATCH] Fix GH-22935: Make php_hash.h includable from C++ code --- ext/hash/php_hash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/hash/php_hash.h b/ext/hash/php_hash.h index b77557c5bf78..bf99ce185b46 100644 --- a/ext/hash/php_hash.h +++ b/ext/hash/php_hash.h @@ -158,7 +158,7 @@ static inline void *php_hash_alloc_context(const php_hash_ops *ops) { /* Zero out context memory so serialization doesn't expose internals */ if (ops->context_align > 0) { size_t align = ops->context_align; - char *base = ecalloc(1, ops->context_size + align); + char *base = (char *) ecalloc(1, ops->context_size + align); size_t offset = align - ((uintptr_t)base & (align - 1)); char *ptr = base + offset; ptr[-1] = (char)offset;