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.
This commit is contained in:
parent
d4b08b7196
commit
5f0ccfb499
Notes:
sideshowbarker
2024-07-17 04:49:48 +09:00
Author: https://github.com/mattco98 Commit: https://github.com/SerenityOS/serenity/commit/5f0ccfb499 Pull-request: https://github.com/SerenityOS/serenity/pull/17620 Issue: https://github.com/SerenityOS/serenity/issues/16988 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/linusg
1 changed files with 2 additions and 2 deletions
|
@ -65,13 +65,13 @@ public:
|
||||||
void visit(GCPtr<T> cell)
|
void visit(GCPtr<T> cell)
|
||||||
{
|
{
|
||||||
if (cell)
|
if (cell)
|
||||||
visit_impl(*cell.ptr());
|
visit_impl(const_cast<RemoveConst<T>&>(*cell.ptr()));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void visit(NonnullGCPtr<T> cell)
|
void visit(NonnullGCPtr<T> cell)
|
||||||
{
|
{
|
||||||
visit_impl(*cell.ptr());
|
visit_impl(const_cast<RemoveConst<T>&>(*cell.ptr()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void visit(Value value)
|
void visit(Value value)
|
||||||
|
|
Loading…
Add table
Reference in a new issue