Skip to content

Commit

Permalink
atomics: fix setonce runtime intrinsic (#55530)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash authored Aug 19, 2024
1 parent 62e7705 commit 2313260
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/datatype.c
Original file line number Diff line number Diff line change
Expand Up @@ -2188,7 +2188,7 @@ inline int setonce_bits(jl_datatype_t *rty, char *p, jl_value_t *parent, jl_valu
}
else {
char *px = lock(p, parent, needlock, isatomic);
success = undefref_check(rty, (jl_value_t*)px) != NULL;
success = undefref_check(rty, (jl_value_t*)px) == NULL;
if (success)
memassign_safe(hasptr, px, rhs, fsz);
unlock(p, parent, needlock, isatomic);
Expand Down
1 change: 1 addition & 0 deletions test/atomics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ test_field_orderings(ARefxy{Union{Nothing,Missing}}(nothing, missing), nothing,
test_field_orderings(ARefxy{Union{Nothing,Int}}(nothing, 123_1), nothing, 123_1)
test_field_orderings(Complex{Int128}(10, 30), Complex{Int128}(20, 40))
test_field_orderings(Complex{Real}(10, 30), Complex{Real}(20, 40))
test_field_orderings(Complex{Rational{Integer}}(10, 30), Complex{Rational{Integer}}(20, 40))
test_field_orderings(10.0, 20.0)
test_field_orderings(NaN, Inf)

Expand Down

0 comments on commit 2313260

Please sign in to comment.