From dc8c291c44224914ea8a9c92559117e2bdb55eb0 Mon Sep 17 00:00:00 2001 From: Frontend release bot Date: Tue, 3 Sep 2024 19:11:27 +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