Skip to content

Commit

Permalink
GH-1145 Move checktime call since it can call, make sure cleanup is s…
Browse files Browse the repository at this point in the history
…etup first.
  • Loading branch information
heifner committed Feb 6, 2025
1 parent 8e2faa6 commit 2329719
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libraries/chain/webassembly/runtimes/eos-vm-oc/executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ void executor::execute(const code_descriptor& code, memory& mem, apply_context&
syscall(SYS_mprotect, self->code_mapping, self->code_mapping_size, PROT_NONE);
self->mapping_is_executable = false;
}, this);
context.trx_context.checktime(); //catch any expiration that might have occurred before setting up callback

auto cleanup = fc::make_scoped_exit([cb, &tt=context.trx_context.transaction_timer, &mem=mem](){
cb->is_running = false;
Expand All @@ -245,6 +244,8 @@ void executor::execute(const code_descriptor& code, memory& mem, apply_context&
}
});

context.trx_context.checktime(); //catch any expiration that might have occurred before setting up callback

void(*apply_func)(uint64_t, uint64_t, uint64_t) = (void(*)(uint64_t, uint64_t, uint64_t))(cb->running_code_base + code.apply_offset);

switch(sigsetjmp(*cb->jmp, 0)) {
Expand Down

0 comments on commit 2329719

Please sign in to comment.