AK: Disallow creating NonnullRawPtrs from r-value references

This would always result in a use-after-free.
This commit is contained in:
Jonne Ransijn 2024-11-15 23:58:02 +01:00
parent db0f019a70
commit 1a03a27c86
No known key found for this signature in database
GPG key ID: 49DC70026D2C578C

View file

@ -21,6 +21,7 @@ public:
using ValueType = T;
NonnullRawPtr() = delete;
NonnullRawPtr(T const&&) = delete;
NonnullRawPtr(T& other)
: m_ptr(&other)