Toying about with this, I discovered another, more realistic bug: Interleaving disparate #[get] and #[set] property descriptions with unrelated entities coerces the getter/setter into consecutive v-table slots. As an example:
#[winrt]
mod Test {
interface ITest {
#[get]
foo: u32;
bar: u32;
#[set]
foo: u32;
}
}
gets round-tripped into:
#[winrt]
mod Test {
interface ITest {
foo: u32;
bar: u32;
}
}
This effectively moves put_foo() in v-table-order ahead of get_bar(), breaking the ABI contract. The v-table entries should instead be: get_foo(), get_bar(), put_bar(), put_foo().
Originally posted by @tim-weis in #4143 (comment)
Toying about with this, I discovered another, more realistic bug: Interleaving disparate
#[get]and#[set]property descriptions with unrelated entities coerces the getter/setter into consecutive v-table slots. As an example:gets round-tripped into:
This effectively moves
put_foo()in v-table-order ahead ofget_bar(), breaking the ABI contract. The v-table entries should instead be:get_foo(),get_bar(),put_bar(),put_foo().Originally posted by @tim-weis in #4143 (comment)