Fix asan issues related to solver and symbol manager (#5457)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Wed, 18 Nov 2020 14:05:31 +0000 (08:05 -0600)
committerGitHub <noreply@github.com>
Wed, 18 Nov 2020 14:05:31 +0000 (08:05 -0600)
Should fix the nightlies.

src/main/command_executor.cpp
src/main/command_executor.h
test/unit/main/interactive_shell_black.h

index be90be3f0fe2780fd51e86885a397af382e200c6..b1a7c70b514f3b6ca5cf4c9cefdc327be46104e3 100644 (file)
@@ -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
 {
index acf9e45bb47e6edc381fcdbbb5ec79a098684da3..4023b86debe201f9b5627955238347a8401cde39 100644 (file)
@@ -61,9 +61,7 @@ class CommandExecutor
  public:
   CommandExecutor(Options& options);
 
-  virtual ~CommandExecutor()
-  {
-  }
+  virtual ~CommandExecutor();
 
   /**
    * Executes a command. Recursively handles if cmd is a command
index 993f246901aa5e46c54520bb0adc671d5cbbb6f4..df6a79bd889a1a060ff5ea6b2aca2a5e6b649317 100644 (file)
@@ -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() {