From d7952d06293129f47c153eb6324f8c98c13a342e Mon Sep 17 00:00:00 2001 From: David Mak Date: Tue, 20 Aug 2024 11:29:19 +0800 Subject: [PATCH] [core] codegen/expr: Fix assertions not generated for -O0 --- nac3core/src/codegen/expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nac3core/src/codegen/expr.rs b/nac3core/src/codegen/expr.rs index 0817fce2..15e73cbb 100644 --- a/nac3core/src/codegen/expr.rs +++ b/nac3core/src/codegen/expr.rs @@ -2195,7 +2195,7 @@ pub fn gen_cmpop_expr_with_values<'ctx, G: CodeGenerator>( gen_list_cmpop(generator, ctx)? } else if [left_ty, right_ty].iter().any(|ty| matches!(&*ctx.unifier.get_ty_immutable(*ty), TypeEnum::TVar { .. })) { - if ctx.registry.llvm_options.opt_level != OptimizationLevel::None { + if ctx.registry.llvm_options.opt_level == OptimizationLevel::None { ctx.make_assert( generator, ctx.ctx.bool_type().const_all_ones(),