From 61942819f2c3b01323e72e065fc23452f78c2d17 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 20 Apr 2020 20:18:02 -0700 Subject: [PATCH] ircd::m::vm: Restore sequence number stackfully on completion. --- matrix/vm_execute.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/matrix/vm_execute.cc b/matrix/vm_execute.cc index 1f91fe25a..6b92d5f3b 100644 --- a/matrix/vm_execute.cc +++ b/matrix/vm_execute.cc @@ -313,6 +313,11 @@ try *eval.opts }; + const scope_restore eval_sequence + { + eval.sequence, 0UL + }; + // The issue hook is only called when this server is injecting a newly // created event. if(eval.copts && eval.copts->issue) @@ -535,7 +540,6 @@ ircd::m::vm::execute_pdu(eval &eval, const auto *const &top(eval::seqmax()); eval.sequence_shared[0] = 0; eval.sequence_shared[1] = 0; - eval.sequence = 0; eval.sequence = { top?