From 92736c4629ecd94b12bbdbfb0700cc049531cf47 Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Mon, 16 Dec 2024 11:22:01 +0000 Subject: [PATCH] smt: allocate subst vars array on the stack, as it is always very small --- smt/expr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smt/expr.cpp b/smt/expr.cpp index c14db1ed9..e771ece70 100644 --- a/smt/expr.cpp +++ b/smt/expr.cpp @@ -2220,13 +2220,13 @@ expr expr::subst(const vector &repls) const { if (repls.empty()) return *this; - unique_ptr vars(new Z3_ast[repls.size()]); + Z3_ast vars[repls.size()]; unsigned i = 0; for (auto &v : repls) { C2(v); vars[i++] = v(); } - return Z3_substitute_vars(ctx(), ast(), repls.size(), vars.get()); + return Z3_substitute_vars(ctx(), ast(), repls.size(), vars); } set expr::vars() const {