mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #16833 - MortimerGoro:layout_alignment, r=SimonSapin
Fix unsafe AtomicRefCell<T> transmutes in Layout component <!-- Please describe your changes on the following line: --> Fixes unsafe transmute between `AtomicRefCell<PersistentLayoutData>` and `AtomicRefCell<PartialPersistentLayoutData>` which have different memory alignment in 32 bit archs leading to SEGV crashes. See https://github.com/servo/servo/issues/16817 and https://github.com/servo/servo/pull/16816 mem::align_of values in 32 bit archs (e.g. Android): ``` PersistentLayoutData 8 PersistentLayoutData 4 AtomicRefCell<PersistentLayoutData> 8 AtomicRefCell<PartialPersistentLayoutData> 4 ``` mem::align_of values in 64 bit archs ``` PersistentLayoutData 8 PersistentLayoutData 8 AtomicRefCell<PersistentLayoutData> 8 AtomicRefCell<PartialPersistentLayoutData> 8 ``` --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #16817 (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/16833) <!-- Reviewable:end -->
This commit is contained in:
commit
47e4c48feb
6 changed files with 39 additions and 0 deletions
|
@ -93,6 +93,7 @@ pub mod wrapper;
|
|||
// For unit tests:
|
||||
pub use fragment::Fragment;
|
||||
pub use fragment::SpecificFragmentInfo;
|
||||
pub use self::data::PersistentLayoutData;
|
||||
|
||||
/// Returns whether the two arguments point to the same value.
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue