]> granicus.if.org Git - clang/commit
[MS ABI] Don't crash when zero-initializing a vbase which contains a vbase
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 12 May 2016 03:51:52 +0000 (03:51 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 12 May 2016 03:51:52 +0000 (03:51 +0000)
commitfe581ebfbabbdcd9c910690005aefe0804cb4b19
treeb529193cd073a5000a9d5f0c58bcf419ddcbff2b
parentcf9fe978839aa983f5bd41a0987f5a8eea1fad87
[MS ABI] Don't crash when zero-initializing a vbase which contains a vbase

Bases can be zero-initialized: the storage is zero-initialized before
the base constructor is run.
The MS ABI has a quirk where base VBPtrs are not installed by the
base constructor but by the most derived class.  In particular, they are
installed before the base constructor is run.
The derived constructor must be careful to zero-initialize only the bits
of the class which haven't already been populated by virtual base
pointers.

While we correctly avoided this scenario, we didn't handle the case
where the base class has virtual bases which have virtual bases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269271 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExprCXX.cpp
test/CodeGenCXX/microsoft-abi-virtual-inheritance.cpp