Skip to content

Commit 522803f

Browse files
committed
Ah there's the bug
Signed-off-by: Bob Weinand <[email protected]>
1 parent 343272e commit 522803f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Zend/zend.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,7 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals) /* {{
735735
compiler_globals->map_ptr_base = ZEND_MAP_PTR_BIASED_BASE(NULL);
736736
compiler_globals->map_ptr_size = 0;
737737
compiler_globals->map_ptr_last = global_map_ptr_last;
738+
compiler_globals->internal_run_time_cache = 0;
738739
if (compiler_globals->map_ptr_last) {
739740
/* Allocate map_ptr table */
740741
compiler_globals->map_ptr_size = ZEND_MM_ALIGNED_SIZE_EX(compiler_globals->map_ptr_last, 4096);

Zend/zend_types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ static zend_always_inline uint32_t zval_gc_info(uint32_t gc_type_info) {
839839
#define ZSTR_GET_CE_CACHE(s) ZSTR_GET_CE_CACHE_EX(s, 1)
840840
#define ZSTR_SET_CE_CACHE(s, ce) ZSTR_SET_CE_CACHE_EX(s, ce, 1)
841841

842-
#define ZSTR_VALID_CE_CACHE(s) EXPECTED((GC_REFCOUNT(s)-1)/sizeof(void *) < CG(map_ptr_last))
842+
#define ZSTR_VALID_CE_CACHE(s) EXPECTED((GC_REFCOUNT(s)-1)/sizeof(void *) < CG(map_ptr_last) - zend_map_ptr_static_size)
843843

844844
#define ZSTR_GET_CE_CACHE_EX(s, validate) \
845845
((!(validate) || ZSTR_VALID_CE_CACHE(s)) ? GET_CE_CACHE(GC_REFCOUNT(s)) : NULL)

0 commit comments

Comments
 (0)