From e7bfd34ea722a3aef2d3d099b1e3b36d261059d4 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 6 Jun 2021 23:08:15 +0100 Subject: [PATCH] LibJS: Add dbgln() to Heap::allocator_for_size() before crashing If we can't get a CellAllocator for the requested cell size, at least print a debug message before dying. --- Userland/Libraries/LibJS/Heap/Heap.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Userland/Libraries/LibJS/Heap/Heap.cpp b/Userland/Libraries/LibJS/Heap/Heap.cpp index 0f9501ee44..5d54058689 100644 --- a/Userland/Libraries/LibJS/Heap/Heap.cpp +++ b/Userland/Libraries/LibJS/Heap/Heap.cpp @@ -47,6 +47,7 @@ ALWAYS_INLINE CellAllocator& Heap::allocator_for_size(size_t cell_size) if (allocator->cell_size() >= cell_size) return *allocator; } + dbgln("Cannot get CellAllocator for cell size {}, largest available is {}!", cell_size, m_allocators.last()->cell_size()); VERIFY_NOT_REACHED(); }