diff options
| -rw-r--r-- | lld/include/lld/Core/ErrorOr.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lld/include/lld/Core/ErrorOr.h b/lld/include/lld/Core/ErrorOr.h index 0fd7d9650b8..85f91858db5 100644 --- a/lld/include/lld/Core/ErrorOr.h +++ b/lld/include/lld/Core/ErrorOr.h @@ -208,6 +208,7 @@ public: return; if (!other.HasError) { // Get the other value. + IsValid = true; new (get()) storage_type(std::move(*other.get())); HasError = false; // Tell other not to do any destruction. @@ -228,7 +229,7 @@ public: return *this; this->~ErrorOr(); - new (this) ErrorOr(other); + new (this) ErrorOr(std::move(other)); return *this; } |

