File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -735,6 +735,7 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals) /* {{
735
735
compiler_globals -> map_ptr_base = ZEND_MAP_PTR_BIASED_BASE (NULL );
736
736
compiler_globals -> map_ptr_size = 0 ;
737
737
compiler_globals -> map_ptr_last = global_map_ptr_last ;
738
+ compiler_globals -> internal_run_time_cache = 0 ;
738
739
if (compiler_globals -> map_ptr_last ) {
739
740
/* Allocate map_ptr table */
740
741
compiler_globals -> map_ptr_size = ZEND_MM_ALIGNED_SIZE_EX (compiler_globals -> map_ptr_last , 4096 );
@@ -2028,11 +2029,11 @@ ZEND_API void *zend_map_ptr_new_static(void)
2028
2029
zend_map_ptr_static_size += 4096 ;
2029
2030
/* Grow map_ptr table */
2030
2031
CG (map_ptr_size ) = ZEND_MM_ALIGNED_SIZE_EX (CG (map_ptr_last ), 4096 );
2031
- /* Note: there are no used non-static map_ptrs yet, hence we don't need to move the whole thing */
2032
2032
CG (map_ptr_real_base ) = perealloc (CG (map_ptr_real_base ), CG (map_ptr_size ) * sizeof (void * ), 1 );
2033
+ memmove ((char * )CG (map_ptr_real_base ) + 4096 * sizeof (void * ), CG (map_ptr_real_base ), (CG (map_ptr_last ) - 4096 ) * sizeof (void * ));
2033
2034
CG (map_ptr_base ) = ZEND_MAP_PTR_BIASED_BASE (CG (map_ptr_real_base ));
2034
2035
}
2035
- ptr = (void * * )CG (map_ptr_real_base ) + zend_map_ptr_static_last ;
2036
+ ptr = (void * * )CG (map_ptr_real_base ) + ( zend_map_ptr_static_last & 4095 ) ;
2036
2037
* ptr = NULL ;
2037
2038
zend_map_ptr_static_last ++ ;
2038
2039
return ZEND_MAP_PTR_PTR2OFFSET (ptr );
Original file line number Diff line number Diff line change @@ -839,7 +839,7 @@ static zend_always_inline uint32_t zval_gc_info(uint32_t gc_type_info) {
839
839
#define ZSTR_GET_CE_CACHE (s ) ZSTR_GET_CE_CACHE_EX(s, 1)
840
840
#define ZSTR_SET_CE_CACHE (s , ce ) ZSTR_SET_CE_CACHE_EX(s, ce, 1)
841
841
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 )
843
843
844
844
#define ZSTR_GET_CE_CACHE_EX (s , validate ) \
845
845
((!(validate) || ZSTR_VALID_CE_CACHE(s)) ? GET_CE_CACHE(GC_REFCOUNT(s)) : NULL)
You can’t perform that action at this time.
0 commit comments