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:
result_ += '*';
consume(*ptr);
} else {
result_ + "<null>";
result_ += "<null>";
}
}
......
......@@ -60,6 +60,9 @@ public:
init();
}
type_erased_tuple_view& operator=(type_erased_tuple_view&&) = delete;
type_erased_tuple_view& operator=(const type_erased_tuple_view&) = delete;
// -- overridden modifiers ---------------------------------------------------
void* get_mutable(size_t pos) override {
......
......@@ -203,7 +203,7 @@ string_sink make_sink(actor_system& sys, const std::string& fn, int flags) {
auto grp = sys.groups().get_local(fn);
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>();
fs->open(fn, append ? std::ios_base::out | std::ios_base::app
: std::ios_base::out);
......
......@@ -51,7 +51,8 @@ error::error(error&& x) noexcept : data_(x.data_) {
}
error& error::operator=(error&& x) noexcept {
std::swap(data_, x.data_);
if (this != &x)
std::swap(data_, x.data_);
return *this;
}
......@@ -60,6 +61,8 @@ error::error(const error& x) : data_(x ? new data(*x.data_) : nullptr) {
}
error& error::operator=(const error& x) {
if (this == &x)
return *this;
if (x) {
if (data_ == nullptr)
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