From 8cdef42785fd294d1727ce1df1b11d754c9bb3d1 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Wed, 18 Nov 2020 08:05:31 -0600 Subject: [PATCH] Fix asan issues related to solver and symbol manager (#5457) Should fix the nightlies. --- src/main/command_executor.cpp | 6 ++++++ src/main/command_executor.h | 4 +--- test/unit/main/interactive_shell_black.h | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/command_executor.cpp b/src/main/command_executor.cpp index be90be3f0..b1a7c70b5 100644 --- a/src/main/command_executor.cpp +++ b/src/main/command_executor.cpp @@ -57,6 +57,12 @@ CommandExecutor::CommandExecutor(Options& options) d_result() { } +CommandExecutor::~CommandExecutor() +{ + // ensure that symbol manager is destroyed before solver + d_symman.reset(nullptr); + d_solver.reset(nullptr); +} void CommandExecutor::flushStatistics(std::ostream& out) const { diff --git a/src/main/command_executor.h b/src/main/command_executor.h index acf9e45bb..4023b86de 100644 --- a/src/main/command_executor.h +++ b/src/main/command_executor.h @@ -61,9 +61,7 @@ class CommandExecutor public: CommandExecutor(Options& options); - virtual ~CommandExecutor() - { - } + virtual ~CommandExecutor(); /** * Executes a command. Recursively handles if cmd is a command diff --git a/test/unit/main/interactive_shell_black.h b/test/unit/main/interactive_shell_black.h index 993f24690..df6a79bd8 100644 --- a/test/unit/main/interactive_shell_black.h +++ b/test/unit/main/interactive_shell_black.h @@ -52,6 +52,9 @@ class InteractiveShellBlack : public CxxTest::TestSuite { delete d_sin; delete d_sout; + // ensure that symbol manager is destroyed before solver + d_symman.reset(nullptr); + d_solver.reset(nullptr); } void testAssertTrue() { -- 2.30.2