Skip to content

Commit

Permalink
fix test and add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Moelf committed Mar 25, 2022
1 parent c10abc5 commit c1c3ea4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ static int NOINLINE compare_fields(const jl_value_t *a, const jl_value_t *b, jl_
if ((ptra == NULL) != (ptrb == NULL)) {
return 0;
}
else {
continue;
}
}
if (!ft->layout->haspadding) {
if (!bits_equal(ao, bo, ft->size))
Expand Down
8 changes: 8 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,14 @@ let abcd = ABCDconst(1, 2, 3, 4)
@test (1, 2, "not constant", 4) === (abcd.a, abcd.b, abcd.c, abcd.d)
end

# test `===` handling null pointer in struct #44712
struct N44712
a::Some{Any}
b::Int
AB() = new()
end

@test unsafe_load(Ptr{N44712}(pointer(Int[0,1]))) !== unsafe_load(Ptr{N44712}(pointer(Int[0,2])))

f47(x::Vector{Vector{T}}) where {T} = 0
@test_throws MethodError f47(Vector{Vector}())
Expand Down

0 comments on commit c1c3ea4

Please sign in to comment.