Skip to content

[gardening] Make sure FieldRecordFlags.Data never contains uninitialized data #6368

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

Merged
merged 1 commit into from
Dec 20, 2016
Merged

[gardening] Make sure FieldRecordFlags.Data never contains uninitialized data #6368

merged 1 commit into from
Dec 20, 2016

Conversation

practicalswift
Copy link
Contributor

This will silence the warning "The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage."

This should probably be reviewed by @bitjammer or @slavapestov :-)

…zed data

This will silence the warning "The left expression of the compound assignment
is an uninitialized value. The computed value will also be garbage."
@practicalswift
Copy link
Contributor Author

@swift-ci please smoke test

@practicalswift
Copy link
Contributor Author

@slavapestov or @DougGregor, would you mind reviewing this? :-)

@bitjammer
Copy link
Contributor

I don't believe I we will we ever construct one of these; they are only reinterpret_cast-ed from metadata that is emitted by IRGen. Might be better to delete the default constructor, if that also silences the warning. The initialization won't hurt, though.

@practicalswift
Copy link
Contributor Author

@bitjammer I tried that but stumbled on a a call to the default constructor of FieldRecordFlags in GenReflection.cpp IIRC :-)

I'm going ahead with the initialization to get rid of the warning for now.

@practicalswift practicalswift merged commit cd91b7b into swiftlang:master Dec 20, 2016
@bitjammer
Copy link
Contributor

Ah yeah, you're right, it looks like we are using it for metadata emission in one place and it is using the default constructor, so it's all good. Thanks!

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