@@ -28,7 +28,7 @@ ZEND_TLS lxb_unicode_idna_t lexbor_idna = {0};
2828
2929static const size_t lexbor_mraw_byte_size = 8192 ;
3030
31- static zend_always_inline void zval_string_or_null_to_lexbor_str (zval * value , lexbor_str_t * lexbor_str )
31+ static zend_always_inline void zval_string_or_null_to_lexbor_str (const zval * value , lexbor_str_t * lexbor_str )
3232{
3333 if (Z_TYPE_P (value ) == IS_STRING && Z_STRLEN_P (value ) > 0 ) {
3434 lexbor_str -> data = (lxb_char_t * ) Z_STRVAL_P (value );
@@ -40,12 +40,12 @@ static zend_always_inline void zval_string_or_null_to_lexbor_str(zval *value, le
4040 }
4141}
4242
43- static zend_always_inline void zval_long_or_null_to_lexbor_str (zval * value , lexbor_str_t * lexbor_str )
43+ static zend_always_inline void zval_long_or_null_to_lexbor_str (const zval * value , lexbor_str_t * lexbor_str )
4444{
4545 if (Z_TYPE_P (value ) == IS_LONG ) {
46- ZVAL_STR ( value , zend_long_to_str (Z_LVAL_P (value ) ));
47- lexbor_str_init_append (lexbor_str , lexbor_parser .mraw , (const lxb_char_t * ) Z_STRVAL_P ( value ), Z_STRLEN_P ( value ));
48- zval_ptr_dtor_str ( value );
46+ zend_string * tmp = zend_long_to_str (Z_LVAL_P (value ));
47+ lexbor_str_init_append (lexbor_str , lexbor_parser .mraw , (const lxb_char_t * ) ZSTR_VAL ( tmp ), ZSTR_LEN ( tmp ));
48+ zend_string_release ( tmp );
4949 } else {
5050 ZEND_ASSERT (Z_ISNULL_P (value ));
5151 lexbor_str -> data = (lxb_char_t * ) "" ;
@@ -257,7 +257,7 @@ static zend_result php_uri_parser_whatwg_scheme_read(void *uri, php_uri_componen
257257 return SUCCESS ;
258258}
259259
260- static zend_result php_uri_parser_whatwg_scheme_write (void * uri , zval * value , zval * errors )
260+ static zend_result php_uri_parser_whatwg_scheme_write (void * uri , const zval * value , zval * errors )
261261{
262262 lxb_url_t * lexbor_uri = uri ;
263263 lexbor_str_t str = {0 };
@@ -297,7 +297,7 @@ static zend_result php_uri_parser_whatwg_username_read(void *uri, php_uri_compon
297297 return SUCCESS ;
298298}
299299
300- static zend_result php_uri_parser_whatwg_username_write (void * uri , zval * value , zval * errors )
300+ static zend_result php_uri_parser_whatwg_username_write (void * uri , const zval * value , zval * errors )
301301{
302302 lxb_url_t * lexbor_uri = uri ;
303303 lexbor_str_t str = {0 };
@@ -326,7 +326,7 @@ static zend_result php_uri_parser_whatwg_password_read(void *uri, php_uri_compon
326326 return SUCCESS ;
327327}
328328
329- static zend_result php_uri_parser_whatwg_password_write (void * uri , zval * value , zval * errors )
329+ static zend_result php_uri_parser_whatwg_password_write (void * uri , const zval * value , zval * errors )
330330{
331331 lxb_url_t * lexbor_uri = uri ;
332332 lexbor_str_t str = {0 };
@@ -411,7 +411,7 @@ ZEND_ATTRIBUTE_NONNULL void php_uri_parser_whatwg_host_type_read(const lxb_url_t
411411 }
412412}
413413
414- static zend_result php_uri_parser_whatwg_host_write (void * uri , zval * value , zval * errors )
414+ static zend_result php_uri_parser_whatwg_host_write (void * uri , const zval * value , zval * errors )
415415{
416416 lxb_url_t * lexbor_uri = uri ;
417417 lexbor_str_t str = {0 };
@@ -440,7 +440,7 @@ static zend_result php_uri_parser_whatwg_port_read(void *uri, php_uri_component_
440440 return SUCCESS ;
441441}
442442
443- static zend_result php_uri_parser_whatwg_port_write (void * uri , zval * value , zval * errors )
443+ static zend_result php_uri_parser_whatwg_port_write (void * uri , const zval * value , zval * errors )
444444{
445445 lxb_url_t * lexbor_uri = uri ;
446446 lexbor_str_t str = {0 };
@@ -469,7 +469,7 @@ static zend_result php_uri_parser_whatwg_path_read(void *uri, php_uri_component_
469469 return SUCCESS ;
470470}
471471
472- static zend_result php_uri_parser_whatwg_path_write (void * uri , zval * value , zval * errors )
472+ static zend_result php_uri_parser_whatwg_path_write (void * uri , const zval * value , zval * errors )
473473{
474474 lxb_url_t * lexbor_uri = uri ;
475475 lexbor_str_t str = {0 };
@@ -498,7 +498,7 @@ static zend_result php_uri_parser_whatwg_query_read(void *uri, php_uri_component
498498 return SUCCESS ;
499499}
500500
501- static zend_result php_uri_parser_whatwg_query_write (void * uri , zval * value , zval * errors )
501+ static zend_result php_uri_parser_whatwg_query_write (void * uri , const zval * value , zval * errors )
502502{
503503 lxb_url_t * lexbor_uri = uri ;
504504 lexbor_str_t str = {0 };
@@ -527,7 +527,7 @@ static zend_result php_uri_parser_whatwg_fragment_read(void *uri, php_uri_compon
527527 return SUCCESS ;
528528}
529529
530- static zend_result php_uri_parser_whatwg_fragment_write (void * uri , zval * value , zval * errors )
530+ static zend_result php_uri_parser_whatwg_fragment_write (void * uri , const zval * value , zval * errors )
531531{
532532 lxb_url_t * lexbor_uri = uri ;
533533 lexbor_str_t str = {0 };
0 commit comments