-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vtbl indices are sometimes incorrect in MSVC ABI #207
Comments
Thanks for the reference. Looks like I will need to wrap and expose |
Does Itanium ABI guarantee ordering of vtbl pointers? If not, maybe it makes sense to expose |
I'm unsure and so I'll be updating it to just query the context always. I've got a PR for TerraFX here: terrafx/terrafx.interop.windows#181 and will be submitting the ClangSharp changes after completing some of the other libClangSharp improvements I'm working on. |
CC. @sotteson1, how should this be handled on the win32metadata side? I don't recall which setup win32metadata is using for vtbls. Is it:
I believe win32metadata is skipping generation for the helper methods that invoke the underlying fnptr, is that right? |
I keep the generation of the helper methods because this gives me the correct method signatures to add to the interface. When I'm emitting an interface, I loop through the method declarations and assume they are always in the correct vtbl order. Is that something that isn't safe to assume? If I had to, I could look deeper into the syntax tree of the body of the function to figure out which element of the lpVtbl the method is calling. |
Apparently not. Andrew raised that http://web.archive.org/web/20141206094130/http://support.microsoft.com/kb/131104 exists and this means that they may not be in declaration order when overloads with the same name exists (as frequently occurs in DComp and D2D1).
I think the available options are:
|
@sotteson1, I went with the third option in #215. There is now a new |
Demo.
OutputVtblHelperMethod
is assumingvtblIndex
is monotonously increasing. That's correct only in simple cases, not with e.g. overloads. Better receive correct information from Clang itself.The text was updated successfully, but these errors were encountered: