Skip to content

Commit

Permalink
Change const checking in if lowering.
Browse files Browse the repository at this point in the history
  • Loading branch information
lerno committed Jan 24, 2025
1 parent 4f130cf commit ba545b4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/llvm_codegen_stmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ba545b4

Please sign in to comment.