@@ -2893,7 +2893,7 @@ ZEND_API zend_string* ZEND_FASTCALL zend_string_tolower_ex(zend_string *str, boo
2893
2893
if (BLOCKCONV_FOUND ()) {
2894
2894
zend_string * res = zend_string_alloc (length , persistent );
2895
2895
memcpy (ZSTR_VAL (res ), ZSTR_VAL (str ), p - (unsigned char * ) ZSTR_VAL (str ));
2896
- unsigned char * q = p + ( ZSTR_VAL (res ) - ZSTR_VAL (str ));
2896
+ unsigned char * q = ( unsigned char * ) ZSTR_VAL (res ) + ( p - ( unsigned char * ) ZSTR_VAL (str ));
2897
2897
2898
2898
/* Lowercase the chunk we already compared. */
2899
2899
BLOCKCONV_INIT_DELTA ('a' - 'A' );
@@ -2915,7 +2915,7 @@ ZEND_API zend_string* ZEND_FASTCALL zend_string_tolower_ex(zend_string *str, boo
2915
2915
zend_string * res = zend_string_alloc (length , persistent );
2916
2916
memcpy (ZSTR_VAL (res ), ZSTR_VAL (str ), p - (unsigned char * ) ZSTR_VAL (str ));
2917
2917
2918
- unsigned char * q = p + ( ZSTR_VAL (res ) - ZSTR_VAL (str ));
2918
+ unsigned char * q = ( unsigned char * ) ZSTR_VAL (res ) + ( p - ( unsigned char * ) ZSTR_VAL (str ));
2919
2919
while (p < end ) {
2920
2920
* q ++ = zend_tolower_ascii (* p ++ );
2921
2921
}
@@ -2942,7 +2942,7 @@ ZEND_API zend_string* ZEND_FASTCALL zend_string_toupper_ex(zend_string *str, boo
2942
2942
if (BLOCKCONV_FOUND ()) {
2943
2943
zend_string * res = zend_string_alloc (length , persistent );
2944
2944
memcpy (ZSTR_VAL (res ), ZSTR_VAL (str ), p - (unsigned char * ) ZSTR_VAL (str ));
2945
- unsigned char * q = p + ( ZSTR_VAL (res ) - ZSTR_VAL (str ));
2945
+ unsigned char * q = ( unsigned char * ) ZSTR_VAL (res ) + ( p - ( unsigned char * ) ZSTR_VAL (str ));
2946
2946
2947
2947
/* Uppercase the chunk we already compared. */
2948
2948
BLOCKCONV_INIT_DELTA ('A' - 'a' );
@@ -2964,7 +2964,7 @@ ZEND_API zend_string* ZEND_FASTCALL zend_string_toupper_ex(zend_string *str, boo
2964
2964
zend_string * res = zend_string_alloc (length , persistent );
2965
2965
memcpy (ZSTR_VAL (res ), ZSTR_VAL (str ), p - (unsigned char * ) ZSTR_VAL (str ));
2966
2966
2967
- unsigned char * q = p + ( ZSTR_VAL (res ) - ZSTR_VAL (str ));
2967
+ unsigned char * q = ( unsigned char * ) ZSTR_VAL (res ) + ( p - ( unsigned char * ) ZSTR_VAL (str ));
2968
2968
while (p < end ) {
2969
2969
* q ++ = zend_toupper_ascii (* p ++ );
2970
2970
}
0 commit comments