@@ -2867,7 +2867,7 @@ ZEND_API zend_string* ZEND_FASTCALL zend_string_tolower_ex(zend_string *str, boo
2867
2867
if (BLOCKCONV_FOUND ()) {
2868
2868
zend_string * res = zend_string_alloc (length , persistent );
2869
2869
memcpy (ZSTR_VAL (res ), ZSTR_VAL (str ), p - (unsigned char * ) ZSTR_VAL (str ));
2870
- unsigned char * q = p + ( ZSTR_VAL (res ) - ZSTR_VAL (str ));
2870
+ unsigned char * q = ( unsigned char * ) ZSTR_VAL (res ) + ( p - ( unsigned char * ) ZSTR_VAL (str ));
2871
2871
2872
2872
/* Lowercase the chunk we already compared. */
2873
2873
BLOCKCONV_INIT_DELTA ('a' - 'A' );
@@ -2889,7 +2889,7 @@ ZEND_API zend_string* ZEND_FASTCALL zend_string_tolower_ex(zend_string *str, boo
2889
2889
zend_string * res = zend_string_alloc (length , persistent );
2890
2890
memcpy (ZSTR_VAL (res ), ZSTR_VAL (str ), p - (unsigned char * ) ZSTR_VAL (str ));
2891
2891
2892
- unsigned char * q = p + ( ZSTR_VAL (res ) - ZSTR_VAL (str ));
2892
+ unsigned char * q = ( unsigned char * ) ZSTR_VAL (res ) + ( p - ( unsigned char * ) ZSTR_VAL (str ));
2893
2893
while (p < end ) {
2894
2894
* q ++ = zend_tolower_ascii (* p ++ );
2895
2895
}
@@ -2916,7 +2916,7 @@ ZEND_API zend_string* ZEND_FASTCALL zend_string_toupper_ex(zend_string *str, boo
2916
2916
if (BLOCKCONV_FOUND ()) {
2917
2917
zend_string * res = zend_string_alloc (length , persistent );
2918
2918
memcpy (ZSTR_VAL (res ), ZSTR_VAL (str ), p - (unsigned char * ) ZSTR_VAL (str ));
2919
- unsigned char * q = p + ( ZSTR_VAL (res ) - ZSTR_VAL (str ));
2919
+ unsigned char * q = ( unsigned char * ) ZSTR_VAL (res ) + ( p - ( unsigned char * ) ZSTR_VAL (str ));
2920
2920
2921
2921
/* Uppercase the chunk we already compared. */
2922
2922
BLOCKCONV_INIT_DELTA ('A' - 'a' );
@@ -2938,7 +2938,7 @@ ZEND_API zend_string* ZEND_FASTCALL zend_string_toupper_ex(zend_string *str, boo
2938
2938
zend_string * res = zend_string_alloc (length , persistent );
2939
2939
memcpy (ZSTR_VAL (res ), ZSTR_VAL (str ), p - (unsigned char * ) ZSTR_VAL (str ));
2940
2940
2941
- unsigned char * q = p + ( ZSTR_VAL (res ) - ZSTR_VAL (str ));
2941
+ unsigned char * q = ( unsigned char * ) ZSTR_VAL (res ) + ( p - ( unsigned char * ) ZSTR_VAL (str ));
2942
2942
while (p < end ) {
2943
2943
* q ++ = zend_toupper_ascii (* p ++ );
2944
2944
}
0 commit comments