[libc-commits] [libc] [libc] add hashtable fuzzing (PR #87949)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Wed Apr 10 14:38:45 PDT 2024


================
@@ -0,0 +1,159 @@
+#include "src/__support/CPP/new.h"
+#include "src/__support/CPP/optional.h"
+#include "src/__support/HashTable/table.h"
+#include "src/string/memcpy.h"
+#include <search.h>
+#include <stdint.h>
+namespace LIBC_NAMESPACE {
+
+enum class Action { Find, Insert, CrossCheck };
+static uint8_t *global_buffer = nullptr;
----------------
michaelrj-google wrote:

why did you do this using a global buffer? This seems like it'd be much simpler if it was just a buffer allocated in the fuzzing function and deleted when the function ends, possibly using its own class. That way you also wouldn't need to have your own cleanup mechanism.

https://github.com/llvm/llvm-project/pull/87949


More information about the libc-commits mailing list