Skip to content
This repository has been archived by the owner. It is now read-only.

Fix dangling pointer causing corrupted output in fill_rect #94

Merged
merged 1 commit into from Aug 17, 2014

Conversation

@dotdash
Copy link
Contributor

dotdash commented Aug 16, 2014

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.

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.
@metajack

This comment has been minimized.

Copy link

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
@metajack metajack merged commit f7b3a1e into servo:master Aug 17, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.