projects
/
cvc5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
252a8fb
)
Fix memory leak in unit test (#3068)
author
Andres Noetzli
<andres.noetzli@gmail.com>
Mon, 24 Jun 2019 10:23:15 +0000
(
03:23
-0700)
committer
Aina Niemetz
<aina.niemetz@gmail.com>
Mon, 24 Jun 2019 10:23:15 +0000
(
03:23
-0700)
PR #3062 changed `Smt2::setLogic()` to return a heap-allocated command,
which didn't get cleaned up by our `parser_black` unit test. This commit
fixes the memory leak.
test/unit/parser/parser_black.h
patch
|
blob
|
history
diff --git
a/test/unit/parser/parser_black.h
b/test/unit/parser/parser_black.h
index f2f5f24b680dadaa9cad35e325d11385de5a4d25..13beedd639d3f9a6d5095e2940fd5159a13a1d5d 100644
(file)
--- a/
test/unit/parser/parser_black.h
+++ b/
test/unit/parser/parser_black.h
@@
-141,7
+141,8
@@
class ParserBlack
if (d_lang == LANG_SMTLIB_V2)
{
// Use QF_LIA to make multiplication ("*") available
- static_cast<Smt2*>(parser)->setLogic("QF_LIA");
+ std::unique_ptr<Command> cmd(
+ static_cast<Smt2*>(parser)->setLogic("QF_LIA"));
}
TS_ASSERT(!parser->done());