mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:07:36 +00:00
LibJS+LibWeb: Remove NonnullGCPtr<T>::operator=(GCPtr<T>) footgun
GCPtr can be null so it's not safe to assign it to a NonnullGCPtr unless you know it to be non-null. This exposed a number of wrong uses in LibWeb which had to be fixed as part of this change.
This commit is contained in:
parent
4abdb68655
commit
d5ed07fdc4
5 changed files with 32 additions and 39 deletions
|
@ -49,13 +49,6 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
NonnullGCPtr& operator=(GCPtr<T> const& other)
|
||||
{
|
||||
m_ptr = const_cast<T*>(other.ptr());
|
||||
VERIFY(m_ptr);
|
||||
return *this;
|
||||
}
|
||||
|
||||
NonnullGCPtr& operator=(T const& other)
|
||||
{
|
||||
m_ptr = &const_cast<T&>(other);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue