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: {
|
case function_t::Native: {
|
||||||
new (&m_value.native) native_function(std::move(other.m_value.native));
|
new (&m_value.native) native_function(std::move(other.m_value.native));
|
||||||
} break;
|
} 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;
|
other.m_value.position = 0;
|
||||||
}
|
}
|
||||||
@@ -34,6 +38,10 @@ function& function::operator=(function&& other) noexcept {
|
|||||||
case function_t::Native: {
|
case function_t::Native: {
|
||||||
new (&m_value.native) native_function(std::move(other.m_value.native));
|
new (&m_value.native) native_function(std::move(other.m_value.native));
|
||||||
} break;
|
} 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;
|
other.m_value.position = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user