aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-10-06 13:26:52 +0100
committerGitHub <noreply@github.com>2025-10-06 13:26:52 +0100
commitbc9e6f852e0fe92d71cce7460f000a9ea830cdab (patch)
tree55d9bddfd2cf4552d8c68169f5b9c566aec02456 /src/llvm_backend.cpp
parent408f318541b9bd969222d8910ce243b5c662ce79 (diff)
parent866486fa1cfac6ea55b78531703214cae3e4ed4a (diff)
Merge pull request #5762 from A1029384756/llvm-14-entry-fix
[llvm-14-entry-fix] bitcast context pointer to match types for llvm 14
Diffstat (limited to 'src/llvm_backend.cpp')
-rw-r--r--src/llvm_backend.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp
index 921084250..c2decf091 100644
--- a/src/llvm_backend.cpp
+++ b/src/llvm_backend.cpp
@@ -2100,7 +2100,8 @@ gb_internal void lb_create_startup_runtime_generate_body(lbModule *m, lbProcedur
lb_end_procedure_body(dummy);
LLVMValueRef context_ptr = lb_find_or_generate_context_ptr(p).addr.value;
- LLVMBuildCall2(p->builder, raw_dummy_type, dummy->value, &context_ptr, 1, "");
+ LLVMValueRef cast_ctx = LLVMBuildBitCast(p->builder, context_ptr, LLVMPointerType(LLVMInt8TypeInContext(m->ctx), 0), "");
+ LLVMBuildCall2(p->builder, raw_dummy_type, dummy->value, &cast_ctx, 1, "");
} else {
lb_init_global_var(m, p, e, init_expr, var);
}