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

Fix missing gc root in jl_cglobal #28747

Merged
merged 1 commit into from
Aug 19, 2018
Merged

Fix missing gc root in jl_cglobal #28747

merged 1 commit into from
Aug 19, 2018

Conversation

Keno
Copy link
Member

@Keno Keno commented Aug 18, 2018

Static analysis complains that the jl_fieldref could allocate,
which then gets passed to jl_bitcast unrooted. I believe it's
right about that.

While we're here, also fix what I believe is a typo (ty vs v).

Static analysis complains that the jl_fieldref could allocate,
which then gets passed to jl_bitcast unrooted. I believe it's
right about that.

While we're here, also fix what I believe is a typo (`ty` vs `v`).
@Keno Keno requested review from vtjnash and yuyichao August 18, 2018 22:17
Copy link
Contributor

@yuyichao yuyichao left a comment

Choose a reason for hiding this comment

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

Seems that this would only fail in the error case.

@Keno
Copy link
Member Author

Keno commented Aug 18, 2018

Which error case are you referring to?

@yuyichao
Copy link
Contributor

I mean (currently) if the input type is valid (string/symbol), jl_fieldref should not actually allocate. Only if it's not valid will it allocate.

@Keno
Copy link
Member Author

Keno commented Aug 18, 2018

Hm, but doesn't the problematic case there explicitly allow it to be a pointer?

@Keno Keno merged commit af3331b into master Aug 19, 2018
@vtjnash
Copy link
Member

vtjnash commented Aug 19, 2018

Yes, it looks like the order of checks here is wrong. Its not supposed to accept a 1-tuple of a pointer

@martinholters martinholters deleted the kf/rtroots branch August 19, 2018 09:46
@KristofferC KristofferC mentioned this pull request Aug 19, 2018
@Keno
Copy link
Member Author

Keno commented Aug 19, 2018

Ok, we can switch around the conditional and use the non-allocating fieldref version then.

@KristofferC KristofferC added bugfix This change fixes an existing bug and removed backport pending 1.0 labels Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants