From: Morgan Deters Date: Thu, 4 Dec 2014 06:39:53 +0000 (-0500) Subject: Fix segfault in lambdas when constructed via API. X-Git-Tag: cvc5-1.0.0~6475 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=68c393b714e3d344df28f44fb1590ad1a73ba819;p=cvc5.git Fix segfault in lambdas when constructed via API. --- diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index 8f5ba2024..659051725 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -1714,11 +1714,13 @@ Node SmtEnginePrivate::expandDefinitions(TNode n, hash_mapfind(func); + SmtEngine::DefinedFunctionMap::const_iterator i = d_smt.d_definedFunctions->find(func); + if(i == d_smt.d_definedFunctions->end()) { + throw TypeCheckingException(n.toExpr(), string("Undefined function: `") + func.toString() + "'"); + } DefinedFunction def = (*i).second; vector formals = def.getFormals(); @@ -1728,9 +1730,6 @@ Node SmtEnginePrivate::expandDefinitions(TNode n, hash_mapend()) { - throw TypeCheckingException(n.toExpr(), string("Undefined function: `") + func.toString() + "'"); - } if(Debug.isOn("expand")) { Debug("expand") << " defn: " << def.getFunction() << endl << " [";