summaryrefslogtreecommitdiffstats
path: root/opt.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2020-11-10 09:55:55 -0500
committerTavian Barnes <tavianator@tavianator.com>2020-11-10 09:55:55 -0500
commit7c79c741bf8ef87d269c470867cfa77637be8b8f (patch)
treee34346e703f31f74119a842f9a6be2a575f9aa20 /opt.c
parent68c96e0b44932196920c2d3f05d5f873e1db69dc (diff)
downloadbfs-7c79c741bf8ef87d269c470867cfa77637be8b8f.tar.xz
opt: Assert that we don't do disabled optimizations
Diffstat (limited to 'opt.c')
-rw-r--r--opt.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/opt.c b/opt.c
index 50ad212..f94e723 100644
--- a/opt.c
+++ b/opt.c
@@ -317,6 +317,8 @@ struct opt_state {
/** Log an optimization. */
BFS_FORMATTER(3, 4)
static bool debug_opt(const struct opt_state *state, int level, const char *format, ...) {
+ assert(state->ctx->optlevel >= level);
+
if (bfs_debug(state->ctx, DEBUG_OPT, "${cyn}-O%d${rs}: ", level)) {
va_list args;
va_start(args, format);