diff options
author | Timothy Flynn <trflynn89@pm.me> | 2022-02-10 07:30:51 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-02-10 14:10:34 +0000 |
commit | a78058bc796de7aa98e41d6176171dc082b81a93 (patch) | |
tree | 18aec6b79584d9653a69e04fd3a93c360829b8aa /Userland/Libraries/LibJS/Runtime | |
parent | 821ae3a4798b01eeca44304b4145f899011d1c1b (diff) | |
download | serenity-a78058bc796de7aa98e41d6176171dc082b81a93.zip |
LibJS: Do not refer to moved-from completions / values
In the ThrowCompletionOr constructors, the VERIFY statements are using
moved-from objects. We should not rely on those objects still being
valid after being moved.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Completion.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Completion.h b/Userland/Libraries/LibJS/Runtime/Completion.h index 94ac00eee2..5e857f1edb 100644 --- a/Userland/Libraries/LibJS/Runtime/Completion.h +++ b/Userland/Libraries/LibJS/Runtime/Completion.h @@ -101,7 +101,7 @@ public: ThrowCompletionOr(Completion throw_completion) : m_throw_completion(move(throw_completion)) { - VERIFY(throw_completion.is_error()); + VERIFY(m_throw_completion->is_error()); } // Not `explicit` on purpose so that `return value;` is possible. @@ -109,7 +109,7 @@ public: : m_value(move(value)) { if constexpr (IsSame<ValueType, Value>) - VERIFY(!value.is_empty()); + VERIFY(!m_value->is_empty()); } // Allows implicit construction of ThrowCompletionOr<T> from a type U if T(U) is a supported constructor. |