diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-11-06 08:55:23 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-11-06 08:55:23 +0000 |
commit | 3400563ea6160dce01a0fb4741bacc4b61db74ad (patch) | |
tree | 65de8aacf79208120323f06efd775625d6015306 /compiler-rt/test | |
parent | 51ff559500c460f7f779019c1bfa964a1c2f223d (diff) | |
download | bcm5719-llvm-3400563ea6160dce01a0fb4741bacc4b61db74ad.tar.gz bcm5719-llvm-3400563ea6160dce01a0fb4741bacc4b61db74ad.zip |
UBSan: Teach isDerivedFromAtOffset and findBaseAtOffset about vbases
When the __virtual_mask is set, __offset_flags >> __offset_shift yields
an offset into the vtable. Dereferencing this vtable slot gets us the
vbase offset.
Adjust a test case to verify that this, in fact, works.
Differential Revision: http://reviews.llvm.org/D6074
llvm-svn: 221445
Diffstat (limited to 'compiler-rt/test')
-rw-r--r-- | compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp index 1e1d67ac369..3a6b1553f9b 100644 --- a/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp +++ b/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr.cpp @@ -48,7 +48,8 @@ struct T : S { virtual int v() { return 1; } }; -struct U : S, T { virtual int v() { return 2; } }; +struct X {}; +struct U : S, T, virtual X { virtual int v() { return 2; } }; struct V : S {}; |