3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-24 09:35:32 +00:00

throw exception instead of debug mode assertion in ast_manager on malformed input

Signed-off-by: Nikolaj Bjorner <nbjorner@hotmail.com>
This commit is contained in:
Nikolaj Bjorner 2015-05-21 15:07:01 -07:00
parent cd8f82ebc2
commit c969d78042
3 changed files with 12 additions and 4 deletions

View file

@ -2043,7 +2043,15 @@ inline app * ast_manager::mk_app_core(func_decl * decl, expr * arg1, expr * arg2
}
app * ast_manager::mk_app(func_decl * decl, unsigned num_args, expr * const * args) {
SASSERT(decl->get_arity() == num_args || decl->is_right_associative() || decl->is_left_associative() || decl->is_chainable());
if (decl->get_arity() != num_args &&
!decl->is_right_associative() &&
!decl->is_left_associative() &&
!decl->is_chainable()) {
std::ostringstream buffer;
buffer << "Wrong number of arguments (" << num_args
<< ") passed to function " << mk_pp(decl, *this);
throw ast_exception(buffer.str().c_str());
}
app * r = 0;
if (num_args > 2 && !decl->is_flat_associative()) {
if (decl->is_right_associative()) {