Commit f4f5ed4d authored by Dominik Charousset's avatar Dominik Charousset

Fix bugs found with PVS-studio, close #583

parent c351c48d
...@@ -172,7 +172,7 @@ public: ...@@ -172,7 +172,7 @@ public:
result_ += '*'; result_ += '*';
consume(*ptr); consume(*ptr);
} else { } else {
result_ + "<null>"; result_ += "<null>";
} }
} }
......
...@@ -60,6 +60,9 @@ public: ...@@ -60,6 +60,9 @@ public:
init(); init();
} }
type_erased_tuple_view& operator=(type_erased_tuple_view&&) = delete;
type_erased_tuple_view& operator=(const type_erased_tuple_view&) = delete;
// -- overridden modifiers --------------------------------------------------- // -- overridden modifiers ---------------------------------------------------
void* get_mutable(size_t pos) override { void* get_mutable(size_t pos) override {
......
...@@ -203,7 +203,7 @@ string_sink make_sink(actor_system& sys, const std::string& fn, int flags) { ...@@ -203,7 +203,7 @@ string_sink make_sink(actor_system& sys, const std::string& fn, int flags) {
auto grp = sys.groups().get_local(fn); auto grp = sys.groups().get_local(fn);
return [grp, fn](std::string&& out) { anon_send(grp, fn, std::move(out)); }; return [grp, fn](std::string&& out) { anon_send(grp, fn, std::move(out)); };
} }
auto append = static_cast<bool>(flags & actor_ostream::append); auto append = (flags & actor_ostream::append) != 0;
auto fs = std::make_shared<std::ofstream>(); auto fs = std::make_shared<std::ofstream>();
fs->open(fn, append ? std::ios_base::out | std::ios_base::app fs->open(fn, append ? std::ios_base::out | std::ios_base::app
: std::ios_base::out); : std::ios_base::out);
......
...@@ -51,6 +51,7 @@ error::error(error&& x) noexcept : data_(x.data_) { ...@@ -51,6 +51,7 @@ error::error(error&& x) noexcept : data_(x.data_) {
} }
error& error::operator=(error&& x) noexcept { error& error::operator=(error&& x) noexcept {
if (this != &x)
std::swap(data_, x.data_); std::swap(data_, x.data_);
return *this; return *this;
} }
...@@ -60,6 +61,8 @@ error::error(const error& x) : data_(x ? new data(*x.data_) : nullptr) { ...@@ -60,6 +61,8 @@ error::error(const error& x) : data_(x ? new data(*x.data_) : nullptr) {
} }
error& error::operator=(const error& x) { error& error::operator=(const error& x) {
if (this == &x)
return *this;
if (x) { if (x) {
if (data_ == nullptr) if (data_ == nullptr)
data_ = new data(*x.data_); data_ = new data(*x.data_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment