]> granicus.if.org Git - clang/commit
MS ABI: Include the vfptr offset in memptrs to virtual methods
authorReid Kleckner <reid@kleckner.net>
Fri, 21 Feb 2014 02:27:32 +0000 (02:27 +0000)
committerReid Kleckner <reid@kleckner.net>
Fri, 21 Feb 2014 02:27:32 +0000 (02:27 +0000)
commit04446d4f786b12a4b7cdb6dedb84af0c298d83de
tree4d2092ffc48da4923db03da1cf0b795d86ee38c3
parente62fd7d3d76c9075bf2d5b8d8bf961e7ae52dc8f
MS ABI: Include the vfptr offset in memptrs to virtual methods

Virtual methods expect 'this' to point to the vfptr containing the
virtual method, and this extends to virtual member pointer thunks.  The
relevant vfptr is always at offset zero on entry to the thunk, and no
this adjustment is needed.

Previously we would not include the vfptr adjustment in the member
pointer, and we'd look at the vfptr offset when loading from the vftable
in the thunk.

Fixes PR18917.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201835 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MicrosoftCXXABI.cpp
test/CodeGenCXX/microsoft-abi-member-pointers.cpp