3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-14 21:08:46 +00:00

operator= checks this equality before moving (#5265)

This commit is contained in:
Zachary Wimer 2021-05-12 13:10:14 -07:00 committed by GitHub
parent 7869cdbbc8
commit f942c3df91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -511,9 +511,11 @@ namespace z3 {
return *this;
}
ast & operator=(ast && s) noexcept {
object::operator=(std::forward<object>(s));
m_ast = s.m_ast;
s.m_ast = nullptr;
if (this != &s) {
object::operator=(std::forward<object>(s));
m_ast = s.m_ast;
s.m_ast = nullptr;
}
return *this;
}
Z3_ast_kind kind() const { Z3_ast_kind r = Z3_get_ast_kind(ctx(), m_ast); check_error(); return r; }