Skip to content

Commit

Permalink
operator= checks this equality before moving (#5265)
Browse files Browse the repository at this point in the history
  • Loading branch information
zwimer authored May 12, 2021
1 parent 7869cdb commit f942c3d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/api/c++/z3++.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down

0 comments on commit f942c3d

Please sign in to comment.