aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/fuzz.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-08-21 19:34:13 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-08-21 19:25:33 +0200
commitfaa5fa9a78d6d23b4e9adea07fdfb34ead170a2f (patch)
treea580529d992ddb465c0edfcdfedf57dc830f93c1 /src/test/fuzz/fuzz.h
parentf5a406f003a060325128db47552089b3254044e3 (diff)
fuzz: Use LIMITED_WHILE instead of limit_max_ops
Diffstat (limited to 'src/test/fuzz/fuzz.h')
-rw-r--r--src/test/fuzz/fuzz.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/fuzz/fuzz.h b/src/test/fuzz/fuzz.h
index ce8fd660aa..c91c33da67 100644
--- a/src/test/fuzz/fuzz.h
+++ b/src/test/fuzz/fuzz.h
@@ -11,6 +11,10 @@
#include <functional>
#include <string_view>
+/**
+ * Can be used to limit a theoretically unbounded loop. This caps the runtime
+ * to avoid timeouts or OOMs.
+ */
#define LIMITED_WHILE(condition, limit) \
for (unsigned _count{limit}; (condition) && _count; --_count)