From ee76bdf84d0f8da4cdc3cb18629d149eb820a624 Mon Sep 17 00:00:00 2001 From: apio Date: Sun, 4 Dec 2022 13:41:14 +0100 Subject: [PATCH] Add sanity check --- kernel/src/memory/Heap.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/src/memory/Heap.cpp b/kernel/src/memory/Heap.cpp index 41ddf176..dfd0ae5f 100644 --- a/kernel/src/memory/Heap.cpp +++ b/kernel/src/memory/Heap.cpp @@ -185,7 +185,9 @@ Result kmalloc(usize size) block->next = block->last = nullptr; heap_start = block; - if (!heap_end) heap_end = heap_start; + check(!heap_end); + + heap_end = heap_start; } HeapBlock* block = heap_start;