summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Olsson <matthewcolsson@gmail.com>2023-02-25 10:44:06 -0700
committerLinus Groh <mail@linusgroh.de>2023-03-06 13:05:43 +0000
commit5f0ccfb4993a79f35637869df8838eb3e340f7fd (patch)
treec476aac278cd4c71d6559aebe39392f4d1263084
parentd4b08b719652c5ad949ffd2b1007a5aeec7c3d06 (diff)
downloadserenity-5f0ccfb4993a79f35637869df8838eb3e340f7fd.zip
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.
-rw-r--r--Userland/Libraries/LibJS/Heap/Cell.h4
1 files 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<T> cell)
{
if (cell)
- visit_impl(*cell.ptr());
+ visit_impl(const_cast<RemoveConst<T>&>(*cell.ptr()));
}
template<typename T>
void visit(NonnullGCPtr<T> cell)
{
- visit_impl(*cell.ptr());
+ visit_impl(const_cast<RemoveConst<T>&>(*cell.ptr()));
}
void visit(Value value)