Skip to content

Commit

Permalink
deps: update simdutf to 5.6.2
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
nodejs-github-bot authored and aduh95 committed Dec 10, 2024
1 parent f557c0e commit 0bd1d3f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
36 changes: 30 additions & 6 deletions deps/simdutf/simdutf.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* auto-generated on 2024-11-12 20:00:19 -0500. Do not edit! */
/* auto-generated on 2024-11-14 14:52:31 -0500. Do not edit! */
/* begin file src/simdutf.cpp */
#include "simdutf.h"
// We include base64_tables once.
Expand Down Expand Up @@ -7229,6 +7229,11 @@ template <class char_type> bool is_ascii_white_space(char_type c) {
return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f';
}

template <class char_type> bool is_ascii_white_space_or_padding(char_type c) {
return c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '\f' ||
c == '=';
}

template <class char_type> bool is_eight_byte(char_type c) {
if (sizeof(char_type) == 1) {
return true;
Expand Down Expand Up @@ -9491,6 +9496,21 @@ simdutf_warn_unused result base64_to_binary_safe_impl(
if (r.error != error_code::INVALID_BASE64_CHARACTER &&
r.error != error_code::BASE64_EXTRA_BITS) {
outlen = r.output_count;
if (last_chunk_handling_options == stop_before_partial) {
if ((r.output_count % 3) != 0) {
bool empty_trail = true;
for (size_t i = r.input_count; i < length; i++) {
if (!scalar::base64::is_ascii_white_space_or_padding(input[i])) {
empty_trail = false;
break;
}
}
if (empty_trail) {
r.input_count = length;
}
}
return {r.error, r.input_count};
}
return {r.error, length};
}
return r;
Expand Down Expand Up @@ -9557,7 +9577,11 @@ simdutf_warn_unused result base64_to_binary_safe_impl(
}
if (rr.error == error_code::SUCCESS &&
last_chunk_handling_options == stop_before_partial) {
rr.count = tail_input - input;
if (tail_input > input + input_index) {
rr.count = tail_input - input;
} else if (r.input_count > 0) {
rr.count = r.input_count + rr.count;
}
return rr;
}
rr.count += input_index;
Expand Down Expand Up @@ -15891,9 +15915,9 @@ compress_decode_base64(char *dst, const char_type *src, size_t srclen,
if (src < srcend + equalsigns) {
full_result r = scalar::base64::base64_tail_decode(
dst, src, srcend - src, equalsigns, options, last_chunk_options);
r.input_count += size_t(src - srcinit);
if (r.error == error_code::INVALID_BASE64_CHARACTER ||
r.error == error_code::BASE64_EXTRA_BITS) {
r.input_count += size_t(src - srcinit);
return r;
} else {
r.output_count += size_t(dst - dstinit);
Expand Down Expand Up @@ -23716,9 +23740,9 @@ compress_decode_base64(char *dst, const chartype *src, size_t srclen,
if (src < srcend + equalsigns) {
full_result r = scalar::base64::base64_tail_decode(
dst, src, srcend - src, equalsigns, options, last_chunk_options);
r.input_count += size_t(src - srcinit);
if (r.error == error_code::INVALID_BASE64_CHARACTER ||
r.error == error_code::BASE64_EXTRA_BITS) {
r.input_count += size_t(src - srcinit);
return r;
} else {
r.output_count += size_t(dst - dstinit);
Expand Down Expand Up @@ -28552,9 +28576,9 @@ compress_decode_base64(char *dst, const chartype *src, size_t srclen,
if (src < srcend + equalsigns) {
full_result r = scalar::base64::base64_tail_decode(
dst, src, srcend - src, equalsigns, options, last_chunk_options);
r.input_count += size_t(src - srcinit);
if (r.error == error_code::INVALID_BASE64_CHARACTER ||
r.error == error_code::BASE64_EXTRA_BITS) {
r.input_count += size_t(src - srcinit);
return r;
} else {
r.output_count += size_t(dst - dstinit);
Expand Down Expand Up @@ -38307,9 +38331,9 @@ compress_decode_base64(char *dst, const chartype *src, size_t srclen,
if (src < srcend + equalsigns) {
full_result r = scalar::base64::base64_tail_decode(
dst, src, srcend - src, equalsigns, options, last_chunk_options);
r.input_count += size_t(src - srcinit);
if (r.error == error_code::INVALID_BASE64_CHARACTER ||
r.error == error_code::BASE64_EXTRA_BITS) {
r.input_count += size_t(src - srcinit);
return r;
} else {
r.output_count += size_t(dst - dstinit);
Expand Down
6 changes: 3 additions & 3 deletions deps/simdutf/simdutf.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* auto-generated on 2024-11-12 20:00:19 -0500. Do not edit! */
/* auto-generated on 2024-11-14 14:52:31 -0500. Do not edit! */
/* begin file include/simdutf.h */
#ifndef SIMDUTF_H
#define SIMDUTF_H
Expand Down Expand Up @@ -670,7 +670,7 @@ SIMDUTF_DISABLE_UNDESIRED_WARNINGS
#define SIMDUTF_SIMDUTF_VERSION_H

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

namespace simdutf {
enum {
Expand All @@ -685,7 +685,7 @@ enum {
/**
* The revision (major.minor.REVISION) of simdutf being used.
*/
SIMDUTF_VERSION_REVISION = 1
SIMDUTF_VERSION_REVISION = 2
};
} // namespace simdutf

Expand Down

0 comments on commit 0bd1d3f

Please sign in to comment.