kernel: add ubsan bindings, fix some UB reported by it

This commit is contained in:
Matheus
2024-12-31 11:20:27 -03:00
parent 4ee5fa42ae
commit 6245a3d19f
11 changed files with 348 additions and 90 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ static void dtor(scache_t *cache, void *obj) {
}
static scache_t *getcachefromsize(size_t size) {
if (size == 0)
if (size <= 1)
return caches[0];
size_t i = 64 - __builtin_clzll(size - 1);