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

Don't use mem::uninitialized() for making calc values #13148

Merged
merged 1 commit into from Sep 2, 2016

Conversation

@Manishearth
Copy link
Member

Manishearth commented Sep 1, 2016

We had code relying on nsStyleCoord::set() being leaky (like it was
before we patched up the calc bindings). Added nsStyleCoord::null() for
this use case since it's not possible to construct directly anymore.

r? @emilio


This change is Reviewable

@highfive
Copy link

highfive commented Sep 1, 2016

Heads up! This PR modifies the following files:

  • @bholley: components/style/properties/gecko.mako.rs, components/style/values/specified/basic_shape.rs
@highfive
Copy link

highfive commented Sep 1, 2016

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
@Manishearth Manishearth force-pushed the Manishearth:calc-null branch from 9206156 to 9c3fe5b Sep 1, 2016
pub fn null() -> Self {
// can't construct directly because it has private
// fields
let mut coord: Self = unsafe { mem::zeroed() };

This comment has been minimized.

Copy link
@emilio

emilio Sep 2, 2016

Member

/me mutters something about accessors...

Is the wrapping of the comment intentionally at ~65 chars?

r=me when it's ready, ideally with the proper wrapping and capitalization in the comment

@Manishearth Manishearth force-pushed the Manishearth:calc-null branch from 9c3fe5b to 5ec2226 Sep 2, 2016
@Manishearth
Copy link
Member Author

Manishearth commented Sep 2, 2016

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented Sep 2, 2016

📌 Commit 5ec2226 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Sep 2, 2016

Testing commit 5ec2226 with merge 7735224...

bors-servo added a commit that referenced this pull request Sep 2, 2016
Don't use mem::uninitialized() for making calc values

We had code relying on `nsStyleCoord::set()` being leaky (like it was
before we patched up the calc bindings). Added `nsStyleCoord::null()` for
this use case since it's not possible to construct directly anymore.

r? @emilio

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13148)
<!-- Reviewable:end -->
We had code relying on `nsStyleCoord::set()` being leaky (like it was before we
patched up the calc bindings). Added `nsStyleCoord::null()` for this use case
since it's not possible to construct directly anymore.
@bors-servo
Copy link
Contributor

bors-servo commented Sep 2, 2016

💔 Test failed - mac-rel-wpt

@highfive
Copy link

highfive commented Sep 2, 2016

  ▶ TIMEOUT [expected PASS] /_mozilla/css/iframe/hide_layers2.html

  ▶ TIMEOUT [expected OK] /html/browsers/windows/nested-browsing-contexts/frameElement.sub.html
@Manishearth
Copy link
Member Author

Manishearth commented Sep 2, 2016

@bors-servo
Copy link
Contributor

bors-servo commented Sep 2, 2016

Previous build results for arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, windows-dev are reusable. Rebuilding only mac-rel-wpt...

@bors-servo
Copy link
Contributor

bors-servo commented Sep 2, 2016

@bors-servo bors-servo merged commit 5ec2226 into servo:master Sep 2, 2016
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@Manishearth Manishearth deleted the Manishearth:calc-null branch May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

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