From 1f68b1f76826f2b89edfe036f07e2067803b2bc6 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Mon, 30 Aug 2021 00:55:24 -0700 Subject: [PATCH] AK: Add operator delete stub to all AK_MAKE_ETERNAL objects Static analysis correctly flags that we are missing an implementation for `operator delete` for all classes which are annotated with AK_MAKE_ETERNAL. To appease static analysis define an implementation which asserts to make sure no one ever calls delete on the object. --- AK/kmalloc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/AK/kmalloc.h b/AK/kmalloc.h index fedfcf7b8f..0a8a220045 100644 --- a/AK/kmalloc.h +++ b/AK/kmalloc.h @@ -42,6 +42,7 @@ inline size_t malloc_good_size(size_t size) { return size; } # define AK_MAKE_ETERNAL \ public: \ void* operator new(size_t size) { return kmalloc_eternal(size); } \ + void operator delete(void*, size_t) { VERIFY_NOT_REACHED(); } \ \ private: #else