From ba545b44f0faa9dc6a61eb60fcedb3615dcf2ce0 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Fri, 24 Jan 2025 16:31:27 +0100 Subject: [PATCH] Change const checking in if lowering. --- src/compiler/llvm_codegen_stmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/llvm_codegen_stmt.c b/src/compiler/llvm_codegen_stmt.c index df8ed2862..c21bfe098 100644 --- a/src/compiler/llvm_codegen_stmt.c +++ b/src/compiler/llvm_codegen_stmt.c @@ -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;