From 79a24132c2575482d3a8a20ff0d7bac1931194dc Mon Sep 17 00:00:00 2001 From: Frontend release bot Date: Tue, 3 Sep 2024 17:01:58 +0200 Subject: [PATCH] Add missing decoder case for NaN --- lib/bson/decoder.ex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/bson/decoder.ex b/lib/bson/decoder.ex index 5e501204..fc982708 100644 --- a/lib/bson/decoder.ex +++ b/lib/bson/decoder.ex @@ -190,6 +190,10 @@ defmodule BSON.DecoderGenerator do {:NaN, rest} end + defp type(@type_float, <<0, 0, 0, 0, 0, 0, 248::little-integer-size(8), 255::little-integer-size(8), rest::binary>>) do + {:NaN, rest} + end + defp type(@type_float, <<1, 0, 0, 0, 0, 0, 240::little-integer-size(8), 127::little-integer-size(8), rest::binary>>) do {:NaN, rest} end