This repository has been archived by the owner. It is now read-only.
Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix dangling pointer causing corrupted output in fill_rect #94
+2
−5
Conversation
The `draw_options` variable within the match expression is only valid for the duration of the match expression, but by using an unsafe pointer the code manages to violate the lifetime rules and creates a pointer to it that's outlives the match expression. Instead of creating a copy of the AzDrawOptions in the match, we can get a ref to the one contained in the Option and hand out of pointer to that one, which lives long enough. Refs servo/servo#3084.
This comment has been minimized.
This comment has been minimized.
metajack
commented on 053d264
Aug 17, 2014
|
r+ |
metajack
added a commit
that referenced
this pull request
Aug 17, 2014
Fix dangling pointer causing corrupted output in fill_rect
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
dotdash commentedAug 16, 2014
The
draw_optionsvariable within the match expression is only validfor the duration of the match expression, but by using an unsafe pointer
the code manages to violate the lifetime rules and creates a pointer
to it that's outlives the match expression.
Instead of creating a copy of the AzDrawOptions in the match, we can get
a ref to the one contained in the Option and hand out of pointer to that
one, which lives long enough.
Refs servo/servo#3084.