diff options
author | Vedant Kumar <vsk@apple.com> | 2016-10-19 20:21:16 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2016-10-19 20:21:16 +0000 |
commit | 018f266bbcf9b825c9e176c0ca18068b731b7304 (patch) | |
tree | a55c24c9dda46e02a64dddb835bb01aab4d0ba7a /lldb/packages/Python/lldbsuite/test/help/TestHelp.py | |
parent | 2d55d67c62c759cb8678c6d59b2ee8ff875609c2 (diff) | |
download | bcm5719-llvm-018f266bbcf9b825c9e176c0ca18068b731b7304.tar.gz bcm5719-llvm-018f266bbcf9b825c9e176c0ca18068b731b7304.zip |
[ubsan] Use the object pointer's type info for devirtualized calls
ubsan reports a false positive 'invalid member call' diagnostic on the
following example (PR30478):
struct Base1 {
virtual int f1() { return 1; }
};
struct Base2 {
virtual int f1() { return 2; }
};
struct Derived2 final : Base1, Base2 {
int f1() override { return 3; }
};
int t1() {
Derived2 d;
return static_cast<Base2 *>(&d)->f1();
}
Adding the "final" attribute to a most-derived class allows clang to
devirtualize member calls into an instance of that class. We should pass
along the type info of the object pointer to avoid the FP. In this case,
that means passing along the type info for 'Derived2' instead of 'Base2'
when checking the dynamic type of static_cast<Base2 *>(&d2).
Differential Revision: https://reviews.llvm.org/D25448
llvm-svn: 284636
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/help/TestHelp.py')
0 files changed, 0 insertions, 0 deletions