Change const checking in if lowering.

This commit is contained in:
Christoffer Lerno
2025-01-24 16:31:27 +01:00
parent 4f130cfe56
commit ba545b44f0

View File

@@ -422,7 +422,7 @@ static void llvm_emit_if_stmt(GenContext *c, Ast *ast)
if (llvm_value_is_const(&be_value) && then_block != else_block)
{
if (LLVMConstIntGetZExtValue(be_value.value))
if (!LLVMIsNull(be_value.value))
{
llvm_emit_br(c, then_block);
else_block = exit_block;