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;