fix(library/compiler/lambda_lifting): make sure auxiliary _lambda declarations come before the declarations that use them

This fixes a nasty initialization bug where an auxiliary `_closed`
declaration for an auxiliary `_lambda` is accessed before it is
initialized.
This commit is contained in:
Leonardo de Moura 2019-02-15 15:22:33 -08:00
parent 542bd432f8
commit 1080edd490

View file

@ -200,7 +200,8 @@ public:
m_base_name = cdecl.fst();
expr r = visit(cdecl.snd(), true);
comp_decl new_cdecl(cdecl.fst(), r);
return mk_pair(m_env, comp_decls(new_cdecl, comp_decls(m_new_decls)));
m_new_decls.push_back(new_cdecl);
return mk_pair(m_env, comp_decls(m_new_decls));
}
};