diff --git a/CMakeLists.txt b/CMakeLists.txt index b887a30d6..c3a1d473b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ endif() project( simdjson # The version number is modified by tools/release.py - VERSION 4.6.0 + VERSION 4.6.1 DESCRIPTION "Parsing gigabytes of JSON per second" HOMEPAGE_URL "https://simdjson.org/" LANGUAGES CXX C diff --git a/Doxyfile b/Doxyfile index 58d350cd7..cf53f7fb7 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = simdjson # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "4.6.0" +PROJECT_NUMBER = "4.6.1" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/include/simdjson/simdjson_version.h b/include/simdjson/simdjson_version.h index 9b76a60f9..3b8f0351e 100644 --- a/include/simdjson/simdjson_version.h +++ b/include/simdjson/simdjson_version.h @@ -4,7 +4,7 @@ #define SIMDJSON_SIMDJSON_VERSION_H /** The version of simdjson being used (major.minor.revision) */ -#define SIMDJSON_VERSION "4.6.0" +#define SIMDJSON_VERSION "4.6.1" namespace simdjson { enum { @@ -19,7 +19,7 @@ enum { /** * The revision (major.minor.REVISION) of simdjson being used. */ - SIMDJSON_VERSION_REVISION = 0 + SIMDJSON_VERSION_REVISION = 1 }; } // namespace simdjson diff --git a/singleheader/simdjson.cpp b/singleheader/simdjson.cpp index d3e3cc362..cbcd9f1e6 100644 --- a/singleheader/simdjson.cpp +++ b/singleheader/simdjson.cpp @@ -1,4 +1,4 @@ -/* auto-generated on 2026-03-30 10:16:31 -0400. version 4.6.0 Do not edit! */ +/* auto-generated on 2026-04-03 15:25:03 -0400. version 4.6.1 Do not edit! */ /* including simdjson.cpp: */ /* begin file simdjson.cpp */ #define SIMDJSON_SRC_SIMDJSON_CPP diff --git a/singleheader/simdjson.h b/singleheader/simdjson.h index 79fba5c1f..0a0215313 100644 --- a/singleheader/simdjson.h +++ b/singleheader/simdjson.h @@ -1,4 +1,4 @@ -/* auto-generated on 2026-03-30 10:16:31 -0400. version 4.6.0 Do not edit! */ +/* auto-generated on 2026-04-03 15:25:03 -0400. version 4.6.1 Do not edit! */ /* including simdjson.h: */ /* begin file simdjson.h */ #ifndef SIMDJSON_H @@ -2538,7 +2538,7 @@ namespace std { #define SIMDJSON_SIMDJSON_VERSION_H /** The version of simdjson being used (major.minor.revision) */ -#define SIMDJSON_VERSION "4.6.0" +#define SIMDJSON_VERSION "4.6.1" namespace simdjson { enum { @@ -2553,7 +2553,7 @@ enum { /** * The revision (major.minor.REVISION) of simdjson being used. */ - SIMDJSON_VERSION_REVISION = 0 + SIMDJSON_VERSION_REVISION = 1 }; } // namespace simdjson @@ -5033,8 +5033,7 @@ inline padded_string padded_string_builder::convert() noexcept { } inline bool padded_string_builder::reserve(size_t additional) noexcept { - // Guard 1: size + additional must not wrap around. - if (simdjson_unlikely(additional > SIZE_MAX - size)) { + if (simdjson_unlikely(additional + size < size)) { return false; // overflow: cannot satisfy request } size_t needed = size + additional; @@ -5045,16 +5044,9 @@ inline bool padded_string_builder::reserve(size_t additional) noexcept { // We are going to grow the capacity exponentially to avoid // repeated allocations. if (new_capacity < 4096) { - // Guard 2: doubling must not wrap around. - if (simdjson_unlikely(new_capacity > SIZE_MAX / 2)) { - return false; // overflow: fall back to exact allocation - } new_capacity *= 2; - } else { - // Guard 3: 1.5x growth must not wrap around. - if (simdjson_unlikely(new_capacity > SIZE_MAX - new_capacity / 2)) { - return false; // overflow: fall back to exact allocation - } + // overflow guard: ensure new_capacity + new_capacity/2 does not overflow + } else if (new_capacity + new_capacity / 2 > new_capacity) { new_capacity += new_capacity / 2; // grow by 1.5x } char *new_data = internal::allocate_padded_buffer(new_capacity); @@ -9506,10 +9498,11 @@ inline bool parser::dump_raw_tape(std::ostream &os) const noexcept { } inline simdjson_result parser::read_file(std::string_view path) noexcept { + const std::string path_copy(path); // Open the file SIMDJSON_PUSH_DISABLE_WARNINGS SIMDJSON_DISABLE_DEPRECATED_WARNING // Disable CRT_SECURE warning on MSVC: manually verified this is safe - std::FILE *fp = std::fopen(path.data(), "rb"); + std::FILE *fp = std::fopen(path_copy.c_str(), "rb"); SIMDJSON_POP_DISABLE_WARNINGS if (fp == nullptr) { diff --git a/singleheader/singleheader.zip b/singleheader/singleheader.zip index 59ff1746d..1e8296232 100644 Binary files a/singleheader/singleheader.zip and b/singleheader/singleheader.zip differ