From b79fd167ef39dc147e148ad1d1604e0cb82e9dab Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Sat, 26 Aug 2023 11:55:21 -0400 Subject: [PATCH] remove copy constructor from backend and use a share method instead --- include/eosio/vm/backend.hpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/include/eosio/vm/backend.hpp b/include/eosio/vm/backend.hpp index 1e2069e..ec662f6 100644 --- a/include/eosio/vm/backend.hpp +++ b/include/eosio/vm/backend.hpp @@ -131,15 +131,6 @@ namespace eosio { namespace vm { construct(); } - backend& operator=(const backend& other) { - if (this != &other) { - mod = other.mod; - exec_ctx_created_by_backend = other.exec_ctx_created_by_backend; - initial_max_call_depth = other.initial_max_call_depth; - initial_max_pages = other.initial_max_pages; - } - return *this; - } ~backend() { if (exec_ctx_created_by_backend && ctx) { @@ -179,6 +170,13 @@ namespace eosio { namespace vm { } } + void share(const backend& from) { + mod = from.mod; + exec_ctx_created_by_backend = from.exec_ctx_created_by_backend; + initial_max_call_depth = from.initial_max_call_depth; + initial_max_pages = from.initial_max_pages; + } + void set_context(context_t* ctx_ptr) { // ctx cannot be set if it is created by the backend assert(!exec_ctx_created_by_backend);