Skip to content

Commit

Permalink
fix #35793, assertion failure with union of singletons (#35812)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored May 9, 2020
1 parent b828bbc commit 8f512f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ static Type *_julia_struct_to_llvm(jl_codegen_params_t *ctx, jl_value_t *jt, jl_
Type *AlignmentType = IntegerType::get(jl_LLVMContext, 8 * al);
unsigned NumATy = fsz / al;
unsigned remainder = fsz % al;
assert(NumATy > 0);
assert(al == 1 || NumATy > 0);
while (NumATy--)
latypes.push_back(AlignmentType);
while (remainder--)
Expand Down
10 changes: 10 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5961,6 +5961,16 @@ let a33709 = A33709(A33709(nothing))
@test isnothing(a33709.a.a)
end

# issue #35793
struct A35793
x::Union{Nothing, Missing}
end
let x = A35793(nothing), y = A35793(missing)
@test x isa A35793
@test x.x === nothing
@test y.x === missing
end

# issue 31583
a31583 = "a"
f31583() = a31583 === "a"
Expand Down

3 comments on commit 8f512f3

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

Please sign in to comment.