0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 23:14:13 +01:00

ircd:Ⓜ️:event: Fix integer value recast (assertion from 8ab735d002).

This commit is contained in:
Jason Volk 2020-09-18 19:06:50 -07:00
parent 60382c2371
commit bb386c5ab4

View file

@ -53,21 +53,27 @@ ircd::m::event::idx
ircd::m::index(std::nothrow_t,
const event::id &event_id)
{
auto &column
static auto &column
{
dbs::event_idx
};
bool found;
alignas(8) char buf[8] {0};
bool found {false};
event::idx ret {0};
if(likely(event_id))
read(column, event_id, found, buf);
constexpr bool safety(false); // we know buf is the right size
return byte_view<event::idx, safety>
{
buf
};
const mutable_buffer buf
{
reinterpret_cast<char *>(&ret), sizeof(ret)
};
const string_view val
{
read(column, event_id, found, buf)
};
}
return ret & boolmask<event::idx>(found);
}
bool