diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2017-10-13 21:02:16 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-10-13 21:02:16 +0000 |
| commit | 868783e85557dde30923fab94c7ffabf5e271818 (patch) | |
| tree | b73834a34f082b28c27bf3397fb302a1e5105687 /llvm/lib/CodeGen/RegAllocBase.cpp | |
| parent | 505e071dc7b266bf92d7fa934ee58df80ed21915 (diff) | |
| download | bcm5719-llvm-868783e85557dde30923fab94c7ffabf5e271818.tar.gz bcm5719-llvm-868783e85557dde30923fab94c7ffabf5e271818.zip | |
LowerTypeTests: Give imported symbols a type with size 0 so that they are not assumed not to alias.
It is possible for both a base and a derived class to be satisfied
with a unique vtable. If a program contains casts of the same pointer
to both of those types, the CFI checks will be lowered to this
(with ThinLTO):
if (p != &__typeid_base_global_addr)
trap();
if (p != &__typeid_derived_global_addr)
trap();
The optimizer may then use the first condition combined
with the assumption that __typeid_base_global_addr and
__typeid_derived_global_addr may not alias to optimize away the second
comparison, resulting in an unconditional trap.
This patch fixes the bug by giving imported globals the type [0 x i8]*,
which prevents the optimizer from assuming that they do not alias.
Differential Revision: https://reviews.llvm.org/D38873
llvm-svn: 315753
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocBase.cpp')
0 files changed, 0 insertions, 0 deletions

