From 5c814e66b3bdafb6e3081bd41512b64c96a074d5 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Sat, 1 Oct 2022 17:17:57 +0300 Subject: [PATCH] LibJS: Store symbols in a Handle inside PropertyKey If the stored symbol is custom (non-global), it is allocated on the heap, and may not be visited by anyone else, so we must register it in order to keep it alive. --- Userland/Libraries/LibJS/Runtime/PropertyKey.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/PropertyKey.h b/Userland/Libraries/LibJS/Runtime/PropertyKey.h index 3dfb6a07796..5be70863fad 100644 --- a/Userland/Libraries/LibJS/Runtime/PropertyKey.h +++ b/Userland/Libraries/LibJS/Runtime/PropertyKey.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include #include @@ -186,7 +187,7 @@ private: Type m_type { Type::Invalid }; u32 m_number { 0 }; FlyString m_string; - Symbol* m_symbol { nullptr }; + Handle m_symbol; }; }