slint/helper_crates
Simon Hausmann 753ec83a05 Fix crash with VRc::borrow() on wasm32
When converting a Weak<VT, T> into Weak<VT, Dyn>, we were ignoring that
while T inside VRcInner may be at a certain offset to satisfy alignment,
the empty Dyn field may not and thus be at a different offset.

On wasm32 for example the compiler generated component struct has a
16-byte alignment, while the Dyn has none. So converting the Weak<VT,
Dyn> to a VRc<VT, Dyn> and then calling borrow() would use the wrong
instance pointer.

To fix this, this patch introduces an extra offset field that's
preserved during the casting and that's used for borrow() as well as
drop().
2020-11-12 11:04:56 +01:00
..
const-field-offset Normalize the spelling of SixtyFPS 2020-10-13 07:48:55 +02:00
vtable Fix crash with VRc::borrow() on wasm32 2020-11-12 11:04:56 +01:00