[core] codegen/expr: Fix missing cast to i1

This commit is contained in:
David Mak 2024-08-27 19:30:25 +08:00 committed by sb10q
parent a59c26aa99
commit 0cc60a3d33

View File

@ -2385,7 +2385,10 @@ pub fn gen_cmpop_expr_with_values<'ctx, G: CodeGenerator>(
})
.map(BasicValueEnum::into_int_value)?;
Ok(ctx.builder.build_not(cmp, "").unwrap())
Ok(ctx.builder.build_not(
generator.bool_to_i1(ctx, cmp),
"",
).unwrap())
},
|_, ctx| {
let bb = ctx.builder.get_insert_block().unwrap();