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 committed by Sam Atkins
commit b7e22f0916
Notes: github-actions[bot] 2024-12-04 16:47:22 +00:00

View file

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