From 5f0ccfb4993a79f35637869df8838eb3e340f7fd Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Sat, 25 Feb 2023 10:44:06 -0700 Subject: LibJS: Accept const GCPtrs in Cell::Visitor The const_cast in these methods should be fine since the object really only needs to be mutable so it's Heap-internal metadata can be altered. --- Userland/Libraries/LibJS/Heap/Cell.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Heap/Cell.h b/Userland/Libraries/LibJS/Heap/Cell.h index 2e7fb0494c..dabd43a47e 100644 --- a/Userland/Libraries/LibJS/Heap/Cell.h +++ b/Userland/Libraries/LibJS/Heap/Cell.h @@ -65,13 +65,13 @@ public: void visit(GCPtr cell) { if (cell) - visit_impl(*cell.ptr()); + visit_impl(const_cast&>(*cell.ptr())); } template void visit(NonnullGCPtr cell) { - visit_impl(*cell.ptr()); + visit_impl(const_cast&>(*cell.ptr())); } void visit(Value value) -- cgit v1.2.3