mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 18:37:34 +00:00
LibJS+LibWeb: Mark NonnullGCPtr::ptr()
as returns_nonnull
This invariant is enforced by the fact that `NonnullGCPtr` can only be constructed from references. This commit fixes an instance where we compared a pointer to null after we have already dereferenced it.
This commit is contained in:
parent
9feb1ce39f
commit
66645cdc94
2 changed files with 4 additions and 4 deletions
|
@ -60,13 +60,13 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
T* operator->() const { return m_ptr; }
|
||||
RETURNS_NONNULL T* operator->() const { return m_ptr; }
|
||||
|
||||
T& operator*() const { return *m_ptr; }
|
||||
|
||||
T* ptr() const { return m_ptr; }
|
||||
RETURNS_NONNULL T* ptr() const { return m_ptr; }
|
||||
|
||||
operator T*() const { return m_ptr; }
|
||||
RETURNS_NONNULL operator T*() const { return m_ptr; }
|
||||
|
||||
operator T&() const { return *m_ptr; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue