fix(furvm): handle import function in function move operators

This commit is contained in:
2026-06-14 23:45:29 +02:00
parent 759ccad7a6
commit e809eb82c7
+9 -1
View File
@@ -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
} // namespace furvm