Skip to content

Commit 9c61038

Browse files
nodejs-github-botaduh95
authored andcommitted
deps: update simdutf to 5.6.2
PR-URL: #55889 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Marco Ippolito <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]>
1 parent fffabca commit 9c61038

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

deps/simdutf/simdutf.cpp

+30-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2024-11-12 20:00:19 -0500. Do not edit! */
1+
/* auto-generated on 2024-11-14 14:52:31 -0500. Do not edit! */
22
/* begin file src/simdutf.cpp */
33
#include "simdutf.h"
44
// We include base64_tables once.
@@ -7229,6 +7229,11 @@ template <class char_type> bool is_ascii_white_space(char_type c) {
72297229
return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f';
72307230
}
72317231

7232+
template <class char_type> bool is_ascii_white_space_or_padding(char_type c) {
7233+
return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' ||
7234+
c == '=';
7235+
}
7236+
72327237
template <class char_type> bool is_eight_byte(char_type c) {
72337238
if (sizeof(char_type) == 1) {
72347239
return true;
@@ -9491,6 +9496,21 @@ simdutf_warn_unused result base64_to_binary_safe_impl(
94919496
if (r.error != error_code::INVALID_BASE64_CHARACTER &&
94929497
r.error != error_code::BASE64_EXTRA_BITS) {
94939498
outlen = r.output_count;
9499+
if (last_chunk_handling_options == stop_before_partial) {
9500+
if ((r.output_count % 3) != 0) {
9501+
bool empty_trail = true;
9502+
for (size_t i = r.input_count; i < length; i++) {
9503+
if (!scalar::base64::is_ascii_white_space_or_padding(input[i])) {
9504+
empty_trail = false;
9505+
break;
9506+
}
9507+
}
9508+
if (empty_trail) {
9509+
r.input_count = length;
9510+
}
9511+
}
9512+
return {r.error, r.input_count};
9513+
}
94949514
return {r.error, length};
94959515
}
94969516
return r;
@@ -9557,7 +9577,11 @@ simdutf_warn_unused result base64_to_binary_safe_impl(
95579577
}
95589578
if (rr.error == error_code::SUCCESS &&
95599579
last_chunk_handling_options == stop_before_partial) {
9560-
rr.count = tail_input - input;
9580+
if (tail_input > input + input_index) {
9581+
rr.count = tail_input - input;
9582+
} else if (r.input_count > 0) {
9583+
rr.count = r.input_count + rr.count;
9584+
}
95619585
return rr;
95629586
}
95639587
rr.count += input_index;
@@ -15891,9 +15915,9 @@ compress_decode_base64(char *dst, const char_type *src, size_t srclen,
1589115915
if (src < srcend + equalsigns) {
1589215916
full_result r = scalar::base64::base64_tail_decode(
1589315917
dst, src, srcend - src, equalsigns, options, last_chunk_options);
15918+
r.input_count += size_t(src - srcinit);
1589415919
if (r.error == error_code::INVALID_BASE64_CHARACTER ||
1589515920
r.error == error_code::BASE64_EXTRA_BITS) {
15896-
r.input_count += size_t(src - srcinit);
1589715921
return r;
1589815922
} else {
1589915923
r.output_count += size_t(dst - dstinit);
@@ -23716,9 +23740,9 @@ compress_decode_base64(char *dst, const chartype *src, size_t srclen,
2371623740
if (src < srcend + equalsigns) {
2371723741
full_result r = scalar::base64::base64_tail_decode(
2371823742
dst, src, srcend - src, equalsigns, options, last_chunk_options);
23743+
r.input_count += size_t(src - srcinit);
2371923744
if (r.error == error_code::INVALID_BASE64_CHARACTER ||
2372023745
r.error == error_code::BASE64_EXTRA_BITS) {
23721-
r.input_count += size_t(src - srcinit);
2372223746
return r;
2372323747
} else {
2372423748
r.output_count += size_t(dst - dstinit);
@@ -28552,9 +28576,9 @@ compress_decode_base64(char *dst, const chartype *src, size_t srclen,
2855228576
if (src < srcend + equalsigns) {
2855328577
full_result r = scalar::base64::base64_tail_decode(
2855428578
dst, src, srcend - src, equalsigns, options, last_chunk_options);
28579+
r.input_count += size_t(src - srcinit);
2855528580
if (r.error == error_code::INVALID_BASE64_CHARACTER ||
2855628581
r.error == error_code::BASE64_EXTRA_BITS) {
28557-
r.input_count += size_t(src - srcinit);
2855828582
return r;
2855928583
} else {
2856028584
r.output_count += size_t(dst - dstinit);
@@ -38307,9 +38331,9 @@ compress_decode_base64(char *dst, const chartype *src, size_t srclen,
3830738331
if (src < srcend + equalsigns) {
3830838332
full_result r = scalar::base64::base64_tail_decode(
3830938333
dst, src, srcend - src, equalsigns, options, last_chunk_options);
38334+
r.input_count += size_t(src - srcinit);
3831038335
if (r.error == error_code::INVALID_BASE64_CHARACTER ||
3831138336
r.error == error_code::BASE64_EXTRA_BITS) {
38312-
r.input_count += size_t(src - srcinit);
3831338337
return r;
3831438338
} else {
3831538339
r.output_count += size_t(dst - dstinit);

deps/simdutf/simdutf.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on 2024-11-12 20:00:19 -0500. Do not edit! */
1+
/* auto-generated on 2024-11-14 14:52:31 -0500. Do not edit! */
22
/* begin file include/simdutf.h */
33
#ifndef SIMDUTF_H
44
#define SIMDUTF_H
@@ -670,7 +670,7 @@ SIMDUTF_DISABLE_UNDESIRED_WARNINGS
670670
#define SIMDUTF_SIMDUTF_VERSION_H
671671

672672
/** The version of simdutf being used (major.minor.revision) */
673-
#define SIMDUTF_VERSION "5.6.1"
673+
#define SIMDUTF_VERSION "5.6.2"
674674

675675
namespace simdutf {
676676
enum {
@@ -685,7 +685,7 @@ enum {
685685
/**
686686
* The revision (major.minor.REVISION) of simdutf being used.
687687
*/
688-
SIMDUTF_VERSION_REVISION = 1
688+
SIMDUTF_VERSION_REVISION = 2
689689
};
690690
} // namespace simdutf
691691

0 commit comments

Comments
 (0)