MethodVFTableLocations in MigrosoftVTableContext contains canonicalized
decl. But, it's sometimes asked to lookup for non-canonicalized decl,
and that causes assertion failure, and compilation failure.
Fixes PR37481.
Details
Details
Diff Detail
Diff Detail
- Repository
- rC Clang
Event Timeline
Comment Actions
I searched around, and I noticed that VTableContext::getMethodVTableIndex has the same implied contract that the caller must always provide a canonical declaration or things will break. It looks like it has three callers, and they all do this. We should probably sink the canonicalization into this helper as well and clean up the now-superfluous canonicalizations at the call site.
Comment Actions
Updated.
As I'm not sure if it's safe to use non-canonicalized CXXMethodDecl for EmitVirtualMemPtrThunk and CGCall, I left using the canonical decl.
For other part, non-canonical decl looks working fine to me.
Comment Actions
lgtm
Shall I go ahead and commit this for you?
lib/AST/VTableBuilder.cpp | ||
---|---|---|
2507 | Thanks for that! |
Thanks for that!