From: Clark Barrett Date: Sat, 20 Aug 2016 02:42:20 +0000 (-0700) Subject: Fixed two bugs X-Git-Tag: cvc5-1.0.0~6040^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6b355496aaf27d46d6a33402814753589b755842;p=cvc5.git Fixed two bugs --- diff --git a/src/printer/cvc/cvc_printer.cpp b/src/printer/cvc/cvc_printer.cpp index bc59e37ba..d09290db5 100644 --- a/src/printer/cvc/cvc_printer.cpp +++ b/src/printer/cvc/cvc_printer.cpp @@ -726,7 +726,7 @@ void CvcPrinter::toStream(std::ostream& out, TNode n, int depth, bool types, boo case kind::BITVECTOR_SIGN_EXTEND: out << "SX("; toStream(out, n[0], depth, types, false); - out << ", " << n.getOperator().getConst() << ')'; + out << ", " << BitVectorType(n.getType().toType()).getSize() << ')'; return; break; case kind::BITVECTOR_ROTATE_LEFT: diff --git a/src/smt/dump.cpp b/src/smt/dump.cpp index eee7b901a..dc1ef792d 100644 --- a/src/smt/dump.cpp +++ b/src/smt/dump.cpp @@ -32,7 +32,9 @@ std::ostream* DumpC::getStreamPointer() { return ::CVC4::DumpOutChannel.getStrea void DumpC::setDumpFromString(const std::string& optarg) { #ifdef CVC4_DUMPING - char* optargPtr = strdup(optarg.c_str()); + // Make a copy of optarg for strtok_r to use. + std::string optargCopy = optarg; + char* optargPtr = const_cast(optargCopy.c_str()); char* tokstr = optargPtr; char* toksave; while((optargPtr = strtok_r(tokstr, ",", &toksave)) != NULL) { @@ -130,7 +132,6 @@ void DumpC::setDumpFromString(const std::string& optarg) { } } } - free(optargPtr); #else /* CVC4_DUMPING */ throw OptionException("The dumping feature was disabled in this build of CVC4."); #endif /* CVC4_DUMPING */