This macro allows to check if certain parts of the code are reachable
during fuzzing.
AC_DEFINE([DEBUG_VALIDATION],[1],[Enable (debug) validation code output])
fi
])
+ AM_CONDITIONAL([DEBUG_VALIDATION], [test "x$enable_debug_validation" = "xyes"])
# profiling support
AC_ARG_ENABLE(profiling,
lua_int8 = ["lua"]
strict = []
debug = []
+debug-validate = []
[dependencies]
nom = "5.0"
RUST_FEATURES += debug
endif
+if DEBUG_VALIDATION
+RUST_FEATURES += debug-validate
+endif
+
if RUST_CROSS_COMPILE
RUST_TARGET = --target $(host_triplet)
endif
);
);
+#[cfg(not(feature = "debug-validate"))]
+#[macro_export]
+macro_rules! debug_validate_bug_on (
+ ($item:expr) => {};
+);
+
+#[cfg(feature = "debug-validate")]
+#[macro_export]
+macro_rules! debug_validate_bug_on (
+ ($item:expr) => {
+ if $item {
+ panic!("Condition check failed");
+ }
+ };
+);
+
/// Convert a String to C-compatible string
///
/// This function will consume the provided data and use the underlying bytes to construct a new