Skip to content

Commit 5436121

Browse files
committed
Fix ext/opcache
1 parent 9ca3626 commit 5436121

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ext/opcache/zend_file_cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ static void *zend_file_cache_serialize_interned(zend_string *str,
271271
}
272272

273273
len = ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(ZSTR_LEN(str)));
274-
ret = (void*)(info->str_size | Z_UL(1));
274+
ret = (void*)(info->str_size | 1);
275275
zend_shared_alloc_register_xlat_entry(str, ret);
276276

277277
zend_string *s = (zend_string*)ZCG(mem);

ext/opcache/zend_shared_alloc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ static zend_always_inline zend_ulong zend_rotr3(zend_ulong key)
403403
int zend_shared_memdup_size(void *source, size_t size)
404404
{
405405
void *old_p;
406-
zend_ulong key = (zend_ulong)source;
406+
zend_ulong key = (zend_ulong)(uintptr_t)source;
407407

408408
key = zend_rotr3(key);
409409
if ((old_p = zend_hash_index_find_ptr(&ZCG(xlat_table), key)) != NULL) {
@@ -420,7 +420,7 @@ static zend_always_inline void *_zend_shared_memdup(void *source, size_t size, b
420420
zend_ulong key;
421421

422422
if (get_xlat) {
423-
key = (zend_ulong)source;
423+
key = (zend_ulong)(uintptr_t)source;
424424
key = zend_rotr3(key);
425425
if ((old_p = zend_hash_index_find_ptr(&ZCG(xlat_table), key)) != NULL) {
426426
/* we already duplicated this pointer */
@@ -432,7 +432,7 @@ static zend_always_inline void *_zend_shared_memdup(void *source, size_t size, b
432432
memcpy(retval, source, size);
433433
if (set_xlat) {
434434
if (!get_xlat) {
435-
key = (zend_ulong)source;
435+
key = (zend_ulong)(uintptr_t)source;
436436
key = zend_rotr3(key);
437437
}
438438
zend_hash_index_add_new_ptr(&ZCG(xlat_table), key, retval);
@@ -575,7 +575,7 @@ void zend_shared_alloc_restore_xlat_table(uint32_t checkpoint)
575575

576576
void zend_shared_alloc_register_xlat_entry(const void *key_pointer, const void *value)
577577
{
578-
zend_ulong key = (zend_ulong)key_pointer;
578+
zend_ulong key = (zend_ulong)(uintptr_t)key_pointer;
579579

580580
key = zend_rotr3(key);
581581
zend_hash_index_add_new_ptr(&ZCG(xlat_table), key, (void*)value);
@@ -584,7 +584,7 @@ void zend_shared_alloc_register_xlat_entry(const void *key_pointer, const void *
584584
void *zend_shared_alloc_get_xlat_entry(const void *key_pointer)
585585
{
586586
void *retval;
587-
zend_ulong key = (zend_ulong)key_pointer;
587+
zend_ulong key = (zend_ulong)(uintptr_t)key_pointer;
588588

589589
key = zend_rotr3(key);
590590
if ((retval = zend_hash_index_find_ptr(&ZCG(xlat_table), key)) == NULL) {

0 commit comments

Comments
 (0)