forked from KPGPMC/furlang
fix(furvm): handle import function in function move operators
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user