Skip to content

RDL property vtable ordering stability #4169

@kennykerr

Description

@kennykerr

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)

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions