Skip to content

Commit

Permalink
revert last two commits; MSVC doesn't like to statically allocate fle…
Browse files Browse the repository at this point in the history
…xible arrays
  • Loading branch information
nunoplopes committed Dec 20, 2023
1 parent 6246c65 commit c4fa719
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/ast/ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,6 @@ struct app_flags {
app_flags() : m_depth(1), m_ground(1), m_has_quantifiers(0), m_has_labels(0) {}
};

namespace smt { class tmp_enode; }

class app : public expr {
friend class ast_manager;

Expand All @@ -722,10 +720,8 @@ class app : public expr {
}

friend class tmp_app;
friend class smt::tmp_enode;

app(func_decl * decl, unsigned num_args, expr * const * args);
app() : expr(AST_APP) {}
public:
func_decl * get_decl() const { return m_decl; }
family_id get_family_id() const { return get_decl()->get_family_id(); }
Expand Down
9 changes: 6 additions & 3 deletions src/smt/smt_enode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,10 @@ namespace smt {
}

tmp_enode::tmp_enode():
m_app(0),
m_capacity(0),
m_enode_data(nullptr) {
SASSERT(m_app.get_app()->get_decl() == 0);
set_capacity(5);
}

Expand All @@ -344,7 +346,7 @@ namespace smt {
m_enode_data = alloc_svect(char, sz);
memset(m_enode_data, 0, sz);
enode * n = get_enode();
n->m_owner = &m_app;
n->m_owner = m_app.get_app();
n->m_root = n;
n->m_next = n;
n->m_class_size = 1;
Expand All @@ -356,11 +358,12 @@ namespace smt {
if (num_args > m_capacity)
set_capacity(num_args * 2);
enode * r = get_enode();
m_app.m_decl = f;
m_app.m_num_args = num_args;
m_app.set_decl(f);
m_app.set_num_args(num_args);
r->m_commutative = num_args == 2 && f->is_commutative();
memcpy(get_enode()->m_args, args, sizeof(enode*)*num_args);
return r;
}

};

2 changes: 1 addition & 1 deletion src/smt/smt_enode.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ namespace smt {
void unmark_enodes2(unsigned num_enodes, enode * const * enodes);

class tmp_enode {
app m_app;
tmp_app m_app;
unsigned m_capacity;
char * m_enode_data;
enode * get_enode() { return reinterpret_cast<enode*>(m_enode_data); }
Expand Down

3 comments on commit c4fa719

@levnach
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nunoplopes, I reverted back to 4898a15 of smt_enode. There were failures like :
C:\dev\z3\build\debug>z3 c:\dev\testz3\regressions\smt2\2879.smt2
ASSERTION VIOLATION
File: C:\dev\z3\src\smt/smt_cg_table.h
Line: 37
n->get_num_args() == 1

@nunoplopes
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nunoplopes, I reverted back to 4898a15 of smt_enode. There were failures like : C:\dev\z3\build\debug>z3 c:\dev\testz3\regressions\smt2\2879.smt2 ASSERTION VIOLATION File: C:\dev\z3\src\smt/smt_cg_table.h Line: 37 n->get_num_args() == 1

Thank you, and apologies for the breakage.

@levnach
Copy link
Contributor

@levnach levnach commented on c4fa719 Dec 21, 2023 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.