This is an archive of the discontinued LLVM Phabricator instance.

[MS ABI] Reuse getVFPtrOffsets instead of using getClassAtVTableLocation
ClosedPublic

Authored by majnemer on Oct 21 2016, 8:57 PM.

Details

Summary

getClassAtVTableLocation hunts through virtual bases without using the
MDC layout which is indicative of a bug.

Instead, reuse the getVFPtrOffsets machinery to calculate which
subobject within the MDC is responsible for the vfptr.

Diff Detail

Repository
rL LLVM

Event Timeline

majnemer updated this revision to Diff 75523.Oct 21 2016, 8:57 PM
majnemer retitled this revision from to [MS ABI] Reuse getVFPtrOffsets instead of using getClassAtVTableLocation.
majnemer updated this object.
majnemer added reviewers: rnk, pcc.
majnemer added a subscriber: cfe-commits.
rnk accepted this revision.Oct 24 2016, 12:33 PM
rnk edited edge metadata.

lgtm

lib/CodeGen/MicrosoftCXXABI.cpp
1779–1780 ↗(On Diff #75523)

Idle thought for future patches: we should feel ML into adjustThisArgumentForVirtualCall to save the double hash lookup.

This revision is now accepted and ready to land.Oct 24 2016, 12:33 PM
This revision was automatically updated to reflect the committed changes.