]> granicus.if.org Git - clang/commit
Currently we're initializing the vtable pointers of a class only after
authorJohn McCall <rjmccall@apple.com>
Fri, 17 Sep 2010 02:31:44 +0000 (02:31 +0000)
committerJohn McCall <rjmccall@apple.com>
Fri, 17 Sep 2010 02:31:44 +0000 (02:31 +0000)
commit7e1dff7a68a4d00e71debafa7f5c259473091746
tree42975cabf3daa3f75cc7a1c414b556af09d21889
parent7a16997c34c18212eb9166f88c6fdd4684b09c07
Currently we're initializing the vtable pointers of a class only after
the bases are completely initialized.  This won't work --- base
initializer expressions can rely on the vtables having been set up.
Check for uses of 'this' in the initializers and force a vtable
initialization if found.

This might not be good enough;  we might need to extend this to handle
the possibility of arbitrary code finding an external reference to this
(not yet completely-constructed!) object and accessing through it,
in which case we'll probably find ourselves doing a lot more unnecessary
stores.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114153 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGClass.cpp
test/CodeGenCXX/constructor-init.cpp