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

Check whether all fields of a mutable struct are defined before SROA #27409

Merged
merged 1 commit into from
Jun 10, 2018

Conversation

Keno
Copy link
Member

@Keno Keno commented Jun 3, 2018

For now, just bail out in this situation. There's a number of better
things we could do here. However, I want to avoid making #26764 worse
for now.

Fixes #27365

test/core.jl Outdated
@@ -6156,6 +6156,19 @@ struct T27269{X, Y <: Vector{X}}
end
@test T27269([[1]]) isa T27269{Int, Vector{Int}}

# issue #27365
mutable struct foo27365
x::Float64
Copy link
Member

Choose a reason for hiding this comment

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

4 space indents

for (fidx, du) in pairs(fielddefuse)
isempty(du.uses) && continue
if fidx + 1 > length(defexpr.args)
ok = false
Copy link
Member

@ararslan ararslan Jun 4, 2018

Choose a reason for hiding this comment

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

I think this now requires a global annotation to avoid a deprecation warning. EDIT: Never mind, that's at the top level, this is in a function.

For now, just bail out in this situation. There's a number of better
things we could do here. However, I want to avoid making #26764 worse
for now.

Fixes #27365
@Keno Keno merged commit 037b3d6 into master Jun 10, 2018
@ararslan ararslan deleted the kf/27365 branch June 10, 2018 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants