diff --git a/Userland/Libraries/LibJS/Heap/Heap.cpp b/Userland/Libraries/LibJS/Heap/Heap.cpp index 8d0e3be1d0..18f1716cd9 100644 --- a/Userland/Libraries/LibJS/Heap/Heap.cpp +++ b/Userland/Libraries/LibJS/Heap/Heap.cpp @@ -92,7 +92,7 @@ void Heap::gather_roots(HashTable& roots) for (auto* list : m_marked_value_lists) { for (auto& value : list->values()) { if (value.is_cell()) - roots.set(value.as_cell()); + roots.set(&value.as_cell()); } } diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp index b6044df7b0..304630b73e 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.cpp +++ b/Userland/Libraries/LibJS/Runtime/VM.cpp @@ -93,15 +93,15 @@ void VM::gather_roots(HashTable& roots) roots.set(m_exception); if (m_last_value.is_cell()) - roots.set(m_last_value.as_cell()); + roots.set(&m_last_value.as_cell()); for (auto& call_frame : m_call_stack) { if (call_frame->this_value.is_cell()) - roots.set(call_frame->this_value.as_cell()); + roots.set(&call_frame->this_value.as_cell()); roots.set(call_frame->arguments_object); for (auto& argument : call_frame->arguments) { if (argument.is_cell()) - roots.set(argument.as_cell()); + roots.set(&argument.as_cell()); } roots.set(call_frame->scope); } diff --git a/Userland/Libraries/LibJS/Runtime/Value.h b/Userland/Libraries/LibJS/Runtime/Value.h index 22b7b49282..af7b6dfd56 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.h +++ b/Userland/Libraries/LibJS/Runtime/Value.h @@ -222,10 +222,10 @@ public: return *m_value.as_symbol; } - Cell* as_cell() + Cell& as_cell() { VERIFY(is_cell()); - return m_value.as_cell; + return *m_value.as_cell; } Accessor& as_accessor() @@ -330,7 +330,7 @@ inline Value js_negative_infinity() inline void Cell::Visitor::visit(Value value) { if (value.is_cell()) - visit_impl(*value.as_cell()); + visit_impl(value.as_cell()); } Value greater_than(GlobalObject&, Value lhs, Value rhs);