Fixing CIDs 1172014 and 1172013: Initializing members of GetProofCommand and GetModel...
authorTim King <taking@cs.nyu.edu>
Tue, 26 Sep 2017 20:02:32 +0000 (13:02 -0700)
committerAndres Noetzli <andres.noetzli@gmail.com>
Tue, 26 Sep 2017 20:02:32 +0000 (13:02 -0700)
src/smt/command.cpp
src/smt/command.h

index 86fb5cdde2e4020dc8fecdb368500b60c05647f9..a4f0c6320d4d76a45b869eb341e1668ac3d42bdc 100644 (file)
@@ -1113,8 +1113,8 @@ std::string GetAssignmentCommand::getCommandName() const throw() {
 
 /* class GetModelCommand */
 
-GetModelCommand::GetModelCommand() throw() {
-}
+GetModelCommand::GetModelCommand() throw()
+    : d_result(nullptr), d_smtEngine(nullptr) {}
 
 void GetModelCommand::invoke(SmtEngine* smtEngine) {
   try {
@@ -1164,8 +1164,8 @@ std::string GetModelCommand::getCommandName() const throw() {
 
 /* class GetProofCommand */
 
-GetProofCommand::GetProofCommand() throw() {
-}
+GetProofCommand::GetProofCommand() throw()
+    : d_result(nullptr), d_smtEngine(nullptr) {}
 
 void GetProofCommand::invoke(SmtEngine* smtEngine) {
   try {
index 1db414cde86b471c56ad46be9f3211901b16593c..0e07583b2b03c86867f625a2695e0a3c88b1ad72 100644 (file)
@@ -602,35 +602,39 @@ public:
 };/* class GetAssignmentCommand */
 
 class CVC4_PUBLIC GetModelCommand : public Command {
-protected:
-  Model* d_result;
-  SmtEngine* d_smtEngine;
-public:
+ public:
   GetModelCommand() throw();
   ~GetModelCommand() throw() {}
   void invoke(SmtEngine* smtEngine);
   // Model is private to the library -- for now
-  //Model* getResult() const throw();
+  // Model* getResult() const throw();
   void printResult(std::ostream& out, uint32_t verbosity = 2) const;
-  Command* exportTo(ExprManager* exprManager, ExprManagerMapCollection& variableMap);
+  Command* exportTo(ExprManager* exprManager,
+                    ExprManagerMapCollection& variableMap);
   Command* clone() const;
   std::string getCommandName() const throw();
-};/* class GetModelCommand */
 
-class CVC4_PUBLIC GetProofCommand : public Command {
-protected:
-  Proof* d_result;
+ protected:
+  Model* d_result;
   SmtEngine* d_smtEngine;
-public:
+}; /* class GetModelCommand */
+
+class CVC4_PUBLIC GetProofCommand : public Command {
+ public:
   GetProofCommand() throw();
   ~GetProofCommand() throw() {}
   void invoke(SmtEngine* smtEngine);
   Proof* getResult() const throw();
   void printResult(std::ostream& out, uint32_t verbosity = 2) const;
-  Command* exportTo(ExprManager* exprManager, ExprManagerMapCollection& variableMap);
+  Command* exportTo(ExprManager* exprManager,
+                    ExprManagerMapCollection& variableMap);
   Command* clone() const;
   std::string getCommandName() const throw();
-};/* class GetProofCommand */
+
+ protected:
+  Proof* d_result;
+  SmtEngine* d_smtEngine;
+}; /* class GetProofCommand */
 
 class CVC4_PUBLIC GetInstantiationsCommand : public Command {
  public: