From 27a395d9643a8d38eb9642170ed3d7877a351029 Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 7 Feb 2021 14:55:56 -0700 Subject: [PATCH] Kernel: Fix KResultOr copy-move from itself case If move-assigning from itself we shouldn't do anything. --- Kernel/KResult.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Kernel/KResult.h b/Kernel/KResult.h index 8c7da0e079..b6988f1364 100644 --- a/Kernel/KResult.h +++ b/Kernel/KResult.h @@ -111,6 +111,8 @@ public: KResultOr& operator=(KResultOr&& other) { + if (&other == this) + return *this; if (!m_is_error && m_have_storage) { value().~T(); m_have_storage = false;