mirror of
https://github.com/nlohmann/json.git
synced 2026-10-24 14:58:54 +00:00
clang-tidy's static analyzer analyzes the forwarding SAX handlers of the error recovery tests (RecoveringDomParser, BasicRecoveringParser) as entry points, with the state of their json_sax_dom_parser member unknown. It then assumes a frame stack of capacity 0 that grow() cannot enlarge (clang-analyzer-security.ArrayBound) and a collected container without an enclosing frame (clang-analyzer-core.NonNullParamChecker). Neither can happen: the stack starts with local_capacity frames, and only a container inside another one is collected. Assert both, which also lets the analyzer discard these paths. Signed-off-by: Niels Lohmann <mail@nlohmann.me>