Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow .V to be null in emit_unionmove #28248

Merged
merged 1 commit into from
Jul 24, 2018
Merged

Allow .V to be null in emit_unionmove #28248

merged 1 commit into from
Jul 24, 2018

Conversation

Keno
Copy link
Member

@Keno Keno commented Jul 23, 2018

We generally handle the case where the .V of a split union is as small
as the active element of the union. If the active element happens to be
a ghost is thus seems reasonable for the split union to not have any storage
at all. Such a union is generated e.g. if we widen from an all-ghost split
union to one that includes sized elements, e.g. in the following example:

function foo()
    x = (1, 2)
    if rand() < 0.5
        if rand() < 0.5
            y = nothing
        else
            y = missing
        end
        x = y
    end
    x
end

Fixes #28208

We generally handle the case where the .V of a split union is as small
as the active element of the union. If the active element happens to be
a ghost is thus seems reasonable for the split union to not have any storage
at all. Such a union is generated e.g. if we widen from an all-ghost split
union to one that includes sized elements, e.g. in the following example:
```
function foo()
    x = (1, 2)
    if rand() < 0.5
        if rand() < 0.5
            y = nothing
        else
            y = missing
        end
        x = y
    end
    x
end
```

Fixes #28208
@ararslan ararslan added compiler:codegen Generation of LLVM IR and native code kind:bugfix This change fixes an existing bug labels Jul 23, 2018
@Keno Keno merged commit 978577f into master Jul 24, 2018
@martinholters martinholters deleted the kf/vnullunion branch July 24, 2018 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code kind:bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants