3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-12 09:03:26 +00:00

remove reinterpret cast occurrences that require disabling strict alias analysis #987 #1210

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-08-17 20:28:49 -07:00
parent 43c2ccb29a
commit ff47c8632b
5 changed files with 24 additions and 30 deletions

View file

@ -35,7 +35,7 @@ Revision History:
parameter::~parameter() {
if (m_kind == PARAM_RATIONAL) {
reinterpret_cast<rational *>(m_rational)->~rational();
dealloc(m_rational);
}
}
@ -50,14 +50,14 @@ parameter& parameter::operator=(parameter const& other) {
return *this;
}
if (m_kind == PARAM_RATIONAL) {
reinterpret_cast<rational *>(m_rational)->~rational();
dealloc(m_rational);
}
m_kind = other.m_kind;
switch(other.m_kind) {
case PARAM_INT: m_int = other.get_int(); break;
case PARAM_AST: m_ast = other.get_ast(); break;
case PARAM_SYMBOL: new (m_symbol) symbol(other.get_symbol()); break;
case PARAM_RATIONAL: new (m_rational) rational(other.get_rational()); break;
case PARAM_SYMBOL: m_symbol = other.m_symbol; break;
case PARAM_RATIONAL: m_rational = alloc(rational, other.get_rational()); break;
case PARAM_DOUBLE: m_dval = other.m_dval; break;
case PARAM_EXTERNAL: m_ext_id = other.m_ext_id; break;
default: