summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-03-28 18:23:35 +0000
committerReid Kleckner <rnk@google.com>2018-03-28 18:23:35 +0000
commiteed882022f6e997942d3e4f0bc07d4dadc3cbd57 (patch)
tree1582ab1f2103fd72ce245afff260470f62d137bc /clang/lib/Frontend/CompilerInvocation.cpp
parent10f50a44c1fa25463b0cb819f424abfbca336c9e (diff)
downloadbcm5719-llvm-eed882022f6e997942d3e4f0bc07d4dadc3cbd57.tar.gz
bcm5719-llvm-eed882022f6e997942d3e4f0bc07d4dadc3cbd57.zip
[MS] Fix bug in method vfptr location code
We were assuming that vbtable indices were assigned in layout order in our comparison, which is not the case. When a virtual method, such as the destructor, appears in multiple vftables, the vftable that appears first in object layout order is the one that points to the main implementation of that method. The later vftables use thunks. In this layout, we adjusted "this" in the main implementation by the amount that is appropriate for 'B' instead of 'A', even though the main implementation is found in D's vftable for A: struct A { virtual ~A() {} }; struct B { virtual ~B() {} }; struct C : virtual B {}; struct D : virtual A, C {}; D's layout looks like: 0 D subobject (empty) 0 C base suboject 8 A base subobject 16 B base subobject With this fix, we correctly adjust by -8 in D's deleting destructor instead of -16. Fixes PR36921. llvm-svn: 328723
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud