File tree Expand file tree Collapse file tree 5 files changed +9
-2
lines changed Expand file tree Collapse file tree 5 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,11 @@ function ThreadSafeModule(mod::Module)
9191 # TODO : expose the other convenience method?
9292 # XXX : work around this by serializing/deserializing the module in the correct contex
9393 bitcode = convert (MemoryBuffer, mod)
94- mod = context! (context (ts_context ())) do
94+ new_mod = context! (context (ts_context ())) do
9595 parse (Module, bitcode)
9696 end
97+ dispose (mod)
98+ mod = new_mod
9799 end
98100 @assert context (mod) == context (ts_context ())
99101
Original file line number Diff line number Diff line change @@ -85,6 +85,8 @@ DEBUG_METADATA_VERSION()
8585 strip_debuginfo! (mod)
8686 @test isempty (metadata (inst))
8787 end
88+
89+ dispose (mod)
8890end
8991
9092end
Original file line number Diff line number Diff line change 541541 @test string (bundle2) == " \" unknown\" (i32 1, i64 2)"
542542 end
543543 end
544+
545+ dispose (mod)
544546 end
545547end
546548
Original file line number Diff line number Diff line change 3535 # it should create a ThreadSafeModule in a ThreadSafeContext matching the
3636 # source context. However, that would result in a TSMod that doesn't match
3737 # the currently-active ts_context()...
38- @test context (copied_mod) != context (src_mod)
38+ @test context (copied_mod) != ctx
3939 @test context (copied_mod) == context (ts_context ())
4040 end
4141 dispose (ts_mod)
Original file line number Diff line number Diff line change 164164 verify (f2)
165165 end
166166
167+ dispose (mod)
167168 end
168169
169170end
You can’t perform that action at this time.
0 commit comments