From b60e1a2ed22111fefa328cfcbdc3fa1cdd2b1555 Mon Sep 17 00:00:00 2001 From: Nikolaj Bjorner Date: Thu, 3 Oct 2024 20:06:45 -0700 Subject: [PATCH] fixup variables Signed-off-by: Nikolaj Bjorner --- src/ast/rewriter/var_subst.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ast/rewriter/var_subst.cpp b/src/ast/rewriter/var_subst.cpp index 4d4c17865..711ca2b51 100644 --- a/src/ast/rewriter/var_subst.cpp +++ b/src/ast/rewriter/var_subst.cpp @@ -59,7 +59,10 @@ expr_ref var_subst::operator()(expr * n, unsigned num_args, expr * const * args) new_args.push_back(arg); else { unsigned idx = to_var(arg)->get_idx(); - new_args.push_back(m_std_order ? args[num_args - idx - 1] : args[idx]); + expr* new_arg = m_std_order ? args[num_args - idx - 1] : args[idx]; + if (!new_arg) + new_arg = arg; + new_args.push_back(new_arg); } } result = m.mk_app(to_app(n)->get_decl(), new_args.size(), new_args.data());