From 197f59b958c20a564aa84b3120b547be556d02f2 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Wed, 18 Sep 2024 22:24:39 -0700 Subject: [PATCH] Update CRoaring --- Gemfile.lock | 1 + ext/roaring/roaring.c | 8 ++++++-- ext/roaring/roaring.h | 6 +++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9375a52..70e449e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -28,6 +28,7 @@ GEM PLATFORMS arm64-darwin-23 + arm64-darwin-24 x86_64-linux DEPENDENCIES diff --git a/ext/roaring/roaring.c b/ext/roaring/roaring.c index 5762b65..04403d9 100644 --- a/ext/roaring/roaring.c +++ b/ext/roaring/roaring.c @@ -1,5 +1,5 @@ // !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!! -// Created by amalgamation.sh on 2024-09-18T08:02:13Z +// Created by amalgamation.sh on 2024-09-19T05:23:09Z /* * The CRoaring project is under a dual license (Apache/MIT). @@ -24630,6 +24630,7 @@ roaring64_bitmap_t *roaring64_bitmap_portable_deserialize_safe( roaring64_bitmap_t *r = roaring64_bitmap_create(); // Iterate through buckets ordered by increasing keys. + int64_t previous_high32 = -1; for (uint64_t bucket = 0; bucket < buckets; ++bucket) { // Read as uint32 the most significant 32 bits of the bucket. uint32_t high32; @@ -24640,7 +24641,10 @@ roaring64_bitmap_t *roaring64_bitmap_portable_deserialize_safe( memcpy(&high32, buf, sizeof(high32)); buf += sizeof(high32); read_bytes += sizeof(high32); - + if (high32 < previous_high32) { + roaring64_bitmap_free(r); + return NULL; + } // Read the 32-bit Roaring bitmaps representing the least significant // bits of a set of elements. size_t bitmap32_size = roaring_bitmap_portable_deserialize_size( diff --git a/ext/roaring/roaring.h b/ext/roaring/roaring.h index 0b77a67..a47aa81 100644 --- a/ext/roaring/roaring.h +++ b/ext/roaring/roaring.h @@ -1,5 +1,5 @@ // !!! DO NOT EDIT - THIS IS AN AUTO-GENERATED FILE !!! -// Created by amalgamation.sh on 2024-09-18T08:02:13Z +// Created by amalgamation.sh on 2024-09-19T05:23:09Z /* * The CRoaring project is under a dual license (Apache/MIT). @@ -59,11 +59,11 @@ // /include/roaring/roaring_version.h automatically generated by release.py, do not change by hand #ifndef ROARING_INCLUDE_ROARING_VERSION #define ROARING_INCLUDE_ROARING_VERSION -#define ROARING_VERSION "4.1.2" +#define ROARING_VERSION "4.1.3" enum { ROARING_VERSION_MAJOR = 4, ROARING_VERSION_MINOR = 1, - ROARING_VERSION_REVISION = 2 + ROARING_VERSION_REVISION = 3 }; #endif // ROARING_INCLUDE_ROARING_VERSION // clang-format on/* end file include/roaring/roaring_version.h */