mirror of
https://github.com/matrix-construct/construct
synced 2024-09-26 18:38:52 +02:00
ircd::json: Antipodal undefined number; add assert that it's not zero.
This commit is contained in:
parent
67ddd4bf87
commit
f641076072
2 changed files with 7 additions and 2 deletions
|
@ -1736,9 +1736,14 @@ const ircd::string_view ircd::json::empty_array { "[]" };
|
|||
decltype(ircd::json::undefined_number)
|
||||
ircd::json::undefined_number
|
||||
{
|
||||
std::numeric_limits<decltype(ircd::json::undefined_number)>::max()
|
||||
std::numeric_limits<decltype(ircd::json::undefined_number)>::min()
|
||||
};
|
||||
|
||||
static_assert
|
||||
(
|
||||
ircd::json::undefined_number != 0
|
||||
);
|
||||
|
||||
std::ostream &
|
||||
ircd::json::operator<<(std::ostream &s, const value &v)
|
||||
{
|
||||
|
|
|
@ -1760,7 +1760,7 @@ ircd::m::event::conforms::conforms(const event &e)
|
|||
if(empty(json::get<"prev_state"_>(e)))
|
||||
set(MISSING_PREV_STATE);
|
||||
|
||||
if(json::get<"depth"_>(e) < 0)
|
||||
if(json::get<"depth"_>(e) != json::undefined_number && json::get<"depth"_>(e) < 0)
|
||||
set(DEPTH_NEGATIVE);
|
||||
|
||||
if(json::get<"type"_>(e) != "m.room.create")
|
||||
|
|
Loading…
Reference in a new issue