From e3dda4e87b39eb142d85dd520af3c772b793a2fb Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 4 Nov 2019 00:21:08 +0100 Subject: [PATCH] Kernel: Fix weird Region constructor that took nullable RefPtr It's never valid to construct a Region with a null Inode pointer using this constructor, so just take a NonnullRefPtr instead. --- Kernel/VM/Region.cpp | 2 +- Kernel/VM/Region.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/VM/Region.cpp b/Kernel/VM/Region.cpp index 682f28f55c..bb2173cf73 100644 --- a/Kernel/VM/Region.cpp +++ b/Kernel/VM/Region.cpp @@ -17,7 +17,7 @@ Region::Region(const Range& range, const String& name, u8 access) MM.register_region(*this); } -Region::Region(const Range& range, RefPtr&& inode, const String& name, u8 access) +Region::Region(const Range& range, NonnullRefPtr inode, const String& name, u8 access) : m_range(range) , m_vmobject(InodeVMObject::create_with_inode(*inode)) , m_name(name) diff --git a/Kernel/VM/Region.h b/Kernel/VM/Region.h index 104661bfad..1d9ce7f5d3 100644 --- a/Kernel/VM/Region.h +++ b/Kernel/VM/Region.h @@ -131,7 +131,7 @@ public: // NOTE: These are public so we can make<> them. Region(const Range&, const String&, u8 access); Region(const Range&, NonnullRefPtr, size_t offset_in_vmo, const String&, u8 access); - Region(const Range&, RefPtr&&, const String&, u8 access); + Region(const Range&, NonnullRefPtr, const String&, u8 access); private: Bitmap& ensure_cow_map() const;