0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 00:32:35 +01:00

modules/vm: Assert options; prevent assignment of eval.

This commit is contained in:
Jason Volk 2019-04-22 12:23:37 -07:00
parent 4c44738dc3
commit b683f1d436
2 changed files with 8 additions and 1 deletions

View file

@ -98,6 +98,8 @@ struct ircd::m::vm::eval
eval() = default;
eval(eval &&) = delete;
eval(const eval &) = delete;
eval &operator=(eval &&) = delete;
eval &operator=(const eval &) = delete;
~eval() noexcept;
static bool for_each(const ctx::ctx *const &, const std::function<bool (eval &)> &);

View file

@ -345,7 +345,12 @@ ircd::m::fetch::hook_handler(const event &event,
vm::eval &eval)
{
assert(eval.opts);
const auto &opts{*eval.opts};
assert(eval.opts->fetch);
const auto &opts
{
*eval.opts
};
const auto &type
{
at<"type"_>(event)