From 1e96e34b54317892083915034c0001fcb8713495 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Wed, 25 Mar 2020 17:11:39 -0700 Subject: [PATCH] ircd::m::vm: Set eval event/event_id members in outer frame. --- matrix/vm_execute.cc | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/matrix/vm_execute.cc b/matrix/vm_execute.cc index d05986bfd..2d6eb99da 100644 --- a/matrix/vm_execute.cc +++ b/matrix/vm_execute.cc @@ -215,22 +215,6 @@ ircd::m::vm::execute(eval &eval, if(m::exists(event.event_id)) return fault::EXISTS; - return execute_du(eval, event); -} - -ircd::m::vm::fault -ircd::m::vm::execute_du(eval &eval, - const event &event) -try -{ - assert(eval.id); - assert(eval.ctx); - assert(eval.opts); - const auto &opts - { - *eval.opts - }; - // Set a member pointer to the event currently being evaluated. This // allows other parallel evals to have deep access to this eval. It also // will be used to count this event as currently being evaluated. @@ -251,10 +235,25 @@ try eval.event_id }; + return execute_du(eval, event); +} + +ircd::m::vm::fault +ircd::m::vm::execute_du(eval &eval, + const event &event) +try +{ + assert(eval.id); + assert(eval.ctx); + assert(eval.opts); assert(eval.opts->edu || event.event_id); assert(eval.opts->edu || eval.event_id); assert(eval.event_id == event.event_id); assert(eval.event_); + const auto &opts + { + *eval.opts + }; // The issue hook is only called when this server is injecting a newly // created event.