Skip to content

Commit

Permalink
apply Sebastian's patch
Browse files Browse the repository at this point in the history
Co-Authored-By: Sebastian Pfitzner <[email protected]>
  • Loading branch information
aviatesk and pfitzseb committed May 27, 2024
1 parent 0393f6f commit d5b0b9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ JL_DLLEXPORT jl_value_t *jl_module_usings(jl_module_t *m)
}

uint8_t _binding_is_from_explicit_using(jl_binding_t *b) {
return (b->owner != b && !b->imported &&
return (jl_atomic_load_relaxed(&b->owner) != NULL && b->owner != b && !b->imported &&
// Modules implicitly get all exported names from Base and Core as if they had
// written `using Base`, but we don't show those via `names()`.
// b->owner->value != (jl_value_t*)jl_base_module && b->owner->value != (jl_value_t*)jl_core_module);
Expand Down
6 changes: 4 additions & 2 deletions test/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,16 @@ let
Symbol("@test_deprecated"), Symbol("@test_logs"), Symbol("@test_nowarn"), Symbol("@test_skip"),
Symbol("@test_throws"), Symbol("@test_warn"), Symbol("@testset"), :GenericArray, :GenericDict,
:GenericOrder, :GenericSet, :GenericString, :Test, :TestSetException, :detect_ambiguities, :detect_unbound_args,
:TestMod7648, :TestModSub9475, :TestMod7648, :a9475, :foo9475, :c7648, :foo7648, :foo7648_nomethods, :Foo7648])
:TestMod7648, :TestModSub9475, :TestMod7648, :a9475, :foo9475, :c7648, :foo7648, :foo7648_nomethods,
:Foo7648, Symbol("@__MODULE__"), :Base, :LogRecord, :(==), :(===), :TestLogger])
@test Set(names(TestMod7648, all = true, usings = true)) == Set([:x36529, :Test, Symbol("@inferred"), Symbol("@test"), Symbol("@test_broken"),
Symbol("@test_deprecated"), Symbol("@test_logs"), Symbol("@test_nowarn"), Symbol("@test_skip"),
Symbol("@test_throws"), Symbol("@test_warn"), Symbol("@testset"), :GenericArray, :GenericDict,
:GenericOrder, :GenericSet, :GenericString, :Test, :TestSetException, :detect_ambiguities, :detect_unbound_args,
:TestMod7648, :TestModSub9475, :a9475, :foo9475, :c7648, :d7648, :f7648,
:foo7648, Symbol("#foo7648"), :foo7648_nomethods, Symbol("#foo7648_nomethods"),
:Foo7648, :eval, Symbol("#eval"), :include, Symbol("#include")])
:Foo7648, :eval, Symbol("#eval"), :include, Symbol("#include"), Symbol("@__MODULE__"), :Base,
:LogRecord, :(==), :(===), :TestLogger])
@test isconst(TestMod7648, :c7648)
@test !isconst(TestMod7648, :d7648)
end
Expand Down

0 comments on commit d5b0b9c

Please sign in to comment.