Skip to content

rfl::json::Reader::to_basic_type<int64_t>: reject unsigned JSON integers > INT64_MAX #106

Done

Description

@clockblocker

Bug

rfl::json::Reader::to_basic_type<int64_t> uses yyjson_is_int, which also matches large unsigned 64-bit JSON integers (> INT64_MAX) and silently wraps/mis-parses them. This breaks std::variant<..., int64_t, uint64_t> disambiguation when int64_t precedes uint64_t.

Evidence

  • Surfaced in osmium-tool#3 Showcase Migration.

Acceptance Criteria

  • Reject unsigned JSON integers > INT64_MAX in to_basic_type<int64_t> (returning an ErrorKind::invalid_value / overflow error rather than wrapping).
  • Add unit tests covering INT64_MAX, INT64_MAX + 1, UINT64_MAX, and std::variant<int64_t, uint64_t> round-trips.

Activity

  1. added
    bug
    ready-for-agent
    on Nov 27, 2026
  2. clockblocker commented on Nov 27, 2026

    @clockblocker
    OwnerAuthor

    Resolved on showcase/all-lanes via Batch 1 merge 4861aafd (commits d4700190, d3673b24). Verified with 962/962 CTest passing under AppleClang 17 -Wall -Werror + REFLECTCPP_STRICT_WARNINGS=ON (non-SYSTEM -I for internal tests, -isystem for downstream consumers) and dual Judge approval (Gemini 4 Neon High: APPROVE WITH NITS, all addressed; Claude Opus 5.5 High re-check: APPROVE).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions