From e809eb82c72835baec26fcc66b10581770c30436 Mon Sep 17 00:00:00 2001 From: CHatingPython Date: Sun, 14 Jun 2026 23:45:29 +0200 Subject: [PATCH] fix(furvm): handle import function in function move operators --- furvm/src/function.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/furvm/src/function.cpp b/furvm/src/function.cpp index 4d1ca25..ac74dc8 100644 --- a/furvm/src/function.cpp +++ b/furvm/src/function.cpp @@ -17,6 +17,10 @@ function::function(function&& other) noexcept case function_t::Native: { new (&m_value.native) native_function(std::move(other.m_value.native)); } break; + case function_t::Import: { + m_value.imp.mod = other.m_value.imp.mod; + m_value.imp.function = other.m_value.imp.function; + } break; } other.m_value.position = 0; } @@ -34,10 +38,14 @@ function& function::operator=(function&& other) noexcept { case function_t::Native: { new (&m_value.native) native_function(std::move(other.m_value.native)); } break; + case function_t::Import: { + m_value.imp.mod = other.m_value.imp.mod; + m_value.imp.function = other.m_value.imp.function; + } break; } other.m_value.position = 0; return *this; } -} // namespace furvm \ No newline at end of file +} // namespace furvm