Skip to content

Commit d5b0b9c

Browse files
aviateskpfitzseb
andcommitted
apply Sebastian's patch
Co-Authored-By: Sebastian Pfitzner <[email protected]>
1 parent 0393f6f commit d5b0b9c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/module.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ JL_DLLEXPORT jl_value_t *jl_module_usings(jl_module_t *m)
992992
}
993993

994994
uint8_t _binding_is_from_explicit_using(jl_binding_t *b) {
995-
return (b->owner != b && !b->imported &&
995+
return (jl_atomic_load_relaxed(&b->owner) != NULL && b->owner != b && !b->imported &&
996996
// Modules implicitly get all exported names from Base and Core as if they had
997997
// written `using Base`, but we don't show those via `names()`.
998998
// b->owner->value != (jl_value_t*)jl_base_module && b->owner->value != (jl_value_t*)jl_core_module);

test/reflection.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,16 @@ let
188188
Symbol("@test_deprecated"), Symbol("@test_logs"), Symbol("@test_nowarn"), Symbol("@test_skip"),
189189
Symbol("@test_throws"), Symbol("@test_warn"), Symbol("@testset"), :GenericArray, :GenericDict,
190190
:GenericOrder, :GenericSet, :GenericString, :Test, :TestSetException, :detect_ambiguities, :detect_unbound_args,
191-
:TestMod7648, :TestModSub9475, :TestMod7648, :a9475, :foo9475, :c7648, :foo7648, :foo7648_nomethods, :Foo7648])
191+
:TestMod7648, :TestModSub9475, :TestMod7648, :a9475, :foo9475, :c7648, :foo7648, :foo7648_nomethods,
192+
:Foo7648, Symbol("@__MODULE__"), :Base, :LogRecord, :(==), :(===), :TestLogger])
192193
@test Set(names(TestMod7648, all = true, usings = true)) == Set([:x36529, :Test, Symbol("@inferred"), Symbol("@test"), Symbol("@test_broken"),
193194
Symbol("@test_deprecated"), Symbol("@test_logs"), Symbol("@test_nowarn"), Symbol("@test_skip"),
194195
Symbol("@test_throws"), Symbol("@test_warn"), Symbol("@testset"), :GenericArray, :GenericDict,
195196
:GenericOrder, :GenericSet, :GenericString, :Test, :TestSetException, :detect_ambiguities, :detect_unbound_args,
196197
:TestMod7648, :TestModSub9475, :a9475, :foo9475, :c7648, :d7648, :f7648,
197198
:foo7648, Symbol("#foo7648"), :foo7648_nomethods, Symbol("#foo7648_nomethods"),
198-
:Foo7648, :eval, Symbol("#eval"), :include, Symbol("#include")])
199+
:Foo7648, :eval, Symbol("#eval"), :include, Symbol("#include"), Symbol("@__MODULE__"), :Base,
200+
:LogRecord, :(==), :(===), :TestLogger])
199201
@test isconst(TestMod7648, :c7648)
200202
@test !isconst(TestMod7648, :d7648)
201203
end

0 commit comments

Comments
 (0)