Skip to content

Commit

Permalink
Fix an assertion in new binding code (#55636)
Browse files Browse the repository at this point in the history
This snuck by me late in the new bindings PR and I didn't notice the
assert builder handn't finished yet.
  • Loading branch information
Keno authored Aug 31, 2024
1 parent 4c2f728 commit e22e4de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ static inline jl_module_t *module_usings_getidx(jl_module_t *m JL_PROPAGATES_ROO
static int eq_bindings(jl_binding_partition_t *owner, jl_binding_t *alias, size_t world)
{
jl_ptr_kind_union_t owner_pku = jl_atomic_load_relaxed(&owner->restriction);
assert(decode_restriction_kind(owner_pku) == BINDING_KIND_GLOBAL ||
assert(decode_restriction_kind(owner_pku) == BINDING_KIND_GLOBAL || decode_restriction_kind(owner_pku) == BINDING_KIND_DECLARED ||
jl_bkind_is_some_constant(decode_restriction_kind(owner_pku)));
jl_binding_partition_t *alias_bpart = jl_get_binding_partition(alias, world);
if (owner == alias_bpart)
Expand Down Expand Up @@ -419,7 +419,7 @@ static jl_binding_t *using_resolve_binding(jl_module_t *m JL_PROPAGATES_ROOT, jl
continue;
jl_binding_partition_t *tempbpart = jl_get_binding_partition(tempb, jl_current_task->world_age);
jl_ptr_kind_union_t tempb_pku = jl_atomic_load_relaxed(&tempbpart->restriction);
assert(decode_restriction_kind(tempb_pku) == BINDING_KIND_GLOBAL || jl_bkind_is_some_constant(decode_restriction_kind(tempb_pku)));
assert(decode_restriction_kind(tempb_pku) == BINDING_KIND_GLOBAL || decode_restriction_kind(tempb_pku) == BINDING_KIND_DECLARED || jl_bkind_is_some_constant(decode_restriction_kind(tempb_pku)));
(void)tempb_pku;
if (bpart != NULL && !tempb->deprecated && !b->deprecated && !eq_bindings(tempbpart, b, jl_current_task->world_age)) {
if (warn) {
Expand Down Expand Up @@ -663,7 +663,7 @@ static void module_import_(jl_module_t *to, jl_module_t *from, jl_sym_t *asname,
else {
jl_binding_partition_t *bpart = jl_get_binding_partition(b, jl_current_task->world_age);
jl_ptr_kind_union_t pku = jl_atomic_load_relaxed(&bpart->restriction);
assert(decode_restriction_kind(pku) == BINDING_KIND_GLOBAL || jl_bkind_is_some_constant(decode_restriction_kind(pku)));
assert(decode_restriction_kind(pku) == BINDING_KIND_GLOBAL || decode_restriction_kind(pku) == BINDING_KIND_DECLARED || jl_bkind_is_some_constant(decode_restriction_kind(pku)));
(void)pku;
if (b->deprecated) {
if (jl_get_binding_value(b) == jl_nothing) {
Expand Down

0 comments on commit e22e4de

Please sign in to comment.