mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-28 20:11:22 +00:00
Fix move Base::operator= (#13355)
### Description Base::operator= move is broken, loses a valid ptr. ### Motivation and Context Address https://github.com/microsoft/onnxruntime/pull/13215#discussion_r997814275
This commit is contained in:
parent
f96f222526
commit
f5e3165cc3
1 changed files with 2 additions and 2 deletions
|
|
@ -292,8 +292,8 @@ struct Base<Unowned<T>> {
|
|||
|
||||
Base(Base&& v) noexcept : p_{v.p_} { v.p_ = nullptr; }
|
||||
Base& operator=(Base&& v) noexcept {
|
||||
auto t = nullptr;
|
||||
std::swap(t, v.p_);
|
||||
p_ = nullptr;
|
||||
std::swap(p_, v.p_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue