Consider a clang-plugin check to verify struct and vtable layouts for XPIDL interfaces
Categories
(Core :: XPCOM, enhancement)
Tracking
()
People
(Reporter: nika, Unassigned)
References
Details
In bug 1778211, I introduced a basic check to the XPIDL compiler to attempt to prevent folks adding virtual methods to XPIDL interfaces, as it can cause issues with XPConnect and the Rust bindings. This follow-up is to look into adding a more complex clang-plugin check by annotating the interface with details about what methods we expect to be declared, and having clang double-check that the struct layout and virtual method order is what we expect.
If we decide to also validate struct layout we may need to introduce a stronger version of [builtinclass] which also prevents the class from being implemented in Rust, as there are some interfaces with extra data fields declared in C++ (such as nsIEventTarget) which can therefore only be implemented by C++ code. This is unfortunately currently not checked by the Rust bindings.
Description
•