From 7c79c741bf8ef87d269c470867cfa77637be8b8f Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 10 Nov 2020 09:55:55 -0500 Subject: opt: Assert that we don't do disabled optimizations --- opt.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'opt.c') 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); -- cgit v1.2.3