From 14a1370f14895c7deddb170f65b4cb2ddd289dc5 Mon Sep 17 00:00:00 2001
From: John Hodge <tpg@mutabah.net>
Date: Thu, 20 Oct 2011 21:12:31 +0800
Subject: [PATCH] Kernel - Updated free's error checking to print the return
 addr

---
 Kernel/heap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Kernel/heap.c b/Kernel/heap.c
index 6915d348..e53f5b85 100644
--- a/Kernel/heap.c
+++ b/Kernel/heap.c
@@ -310,8 +310,8 @@ void Heap_Deallocate(void *Ptr)
 	// Sanity check
 	if((Uint)Ptr < (Uint)gHeapStart || (Uint)Ptr > (Uint)gHeapEnd)
 	{
-		Log_Warning("Heap", "free - Passed a non-heap address (%p < %p < %p)\n",
-			gHeapStart, Ptr, gHeapEnd);
+		Log_Warning("Heap", "free - Passed a non-heap address by %p (%p < %p < %p)\n",
+			__builtin_return_address(0), gHeapStart, Ptr, gHeapEnd);
 		return;
 	}
 	
-- 
GitLab