Skip to content

Commit

Permalink
Fix: LLVM 14 and below need explicit pointer cast (i8* -> i1*)
Browse files Browse the repository at this point in the history
  • Loading branch information
ysbaddaden committed Jan 14, 2025
1 parent 2296069 commit 2c1c20b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/compiler/crystal/codegen/once.cr
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ class Crystal::CodeGenVisitor
end

state = load(once_state_type, once_state_global)
args = [state, flag, initializer]
# cast Int8* to Bool* (required for LLVM 14 and below)
bool = bit_cast(flag, @llvm_context.int1.pointer)
args = [state, bool, initializer]
end

call once_fun, args
Expand Down

0 comments on commit 2c1c20b

Please sign in to comment.