Skip to content

Commit 7607224

Browse files
committed
Fix LLVM contexts in RT maps
1 parent a24627b commit 7607224

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/runtime/maps.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@ function map_delete_elem(map::RTMap{Name,MT,K,V,ME,F}, key::K) where {Name,MT,K,
3939
end
4040
function _genmap!(mod::LLVM.Module, ::Type{<:RTMap{Name,MT,K,V,ME,F}}, ctx) where {Name,MT,K,V,ME,F}
4141
T_i32 = LLVM.Int32Type(ctx)
42-
T_map = LLVM.StructType([T_i32, T_i32, T_i32, T_i32, T_i32])
42+
T_map = LLVM.StructType([T_i32, T_i32, T_i32, T_i32, T_i32], ctx)
4343
name = string(Name)
4444
gv = GlobalVariable(mod, T_map, name)
4545
section!(gv, "maps")
4646
alignment!(gv, 4)
4747
vec = Any[Int32(MT),Int32(sizeof(K)),Int32(sizeof(V)),Int32(ME),Int32(F)]
48-
A_vec = [ConstantInt(v, ctx) for v in vec]
49-
init = LLVM.API.LLVMConstStruct(A_vec, length(A_vec), 0)
50-
init = ConstantStruct(init)
48+
init = ConstantStruct([ConstantInt(v, ctx) for v in vec], ctx)
5149
initializer!(gv, init)
5250
linkage!(gv, LLVM.API.LLVMLinkOnceODRLinkage)
5351
return gv

0 commit comments

Comments
 (0)