Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework initialization of constants & class variables #15333

Merged
merged 12 commits into from
Jan 20, 2025
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)
ysbaddaden marked this conversation as resolved.
Show resolved Hide resolved
args = [state, bool, initializer]
end

call once_fun, args
Expand Down
Loading