Update fst from upstream (#6771 partial)

This commit is contained in:
Wilson Snyder 2026-06-22 17:25:59 -04:00
parent bf50baefee
commit c927f05f35
3 changed files with 10 additions and 8 deletions

View File

@ -81,6 +81,12 @@
std::abort(); \
}
#define FST_FAIL_STRING(s) \
do { \
std::cerr << (s) << std::endl; \
std::abort(); \
} while (0)
// We turn on all DCHECKs to CHECKs temporarily for better safety.
#if 1
# define FST_DCHECK(a) FST_CHECK(a)

View File

@ -335,10 +335,10 @@ public:
// Double variables should not use these array-based emitValueChange overloads.
// We implement them to satisfy the VairableInfo::dispatchHelper template instantiation.
void emitValueChange(uint64_t, const uint32_t *, EncodingType) {
throw std::runtime_error("emitValueChange(uint32_t*) not supported for Double");
FST_FAIL_STRING("emitValueChange(uint32_t*) not supported for Double");
}
void emitValueChange(uint64_t, const uint64_t *, EncodingType) {
throw std::runtime_error("emitValueChange(uint64_t*) not supported for Double");
FST_FAIL_STRING("emitValueChange(uint64_t*) not supported for Double");
}
void dumpInitialBits(std::vector<uint8_t> &buf) const {

View File

@ -193,7 +193,7 @@ Handle Writer::createVar(
// (void)type;
// (void)svt;
// (void)sdt;
// throw std::runtime_error("TODO");
// FST_FAIL_STRING("TODO");
// return 0;
// }
// LCOV_EXCL_STOP
@ -353,11 +353,7 @@ void compressUsingZlib(
uncompressed_size,
level
);
if (z_status != Z_OK) {
throw std::runtime_error(
"Failed to compress data with zlib, error code: " + std::to_string(z_status)
);
}
FST_CHECK_EQ(z_status, Z_OK);
compressed_data.resize(compressed_bound);
}