diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2017-03-02 23:10:17 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-03-02 23:10:17 +0000 |
commit | 3baa72af7d65c3d5199b3d57bfa2b6c1268306b2 (patch) | |
tree | 52ad5b614d7aea24876bb24f08bf12f7bff27e4b /llvm/lib | |
parent | dcb004fdf1dbebc2792fe27c4f1c638e84066d8b (diff) | |
download | bcm5719-llvm-3baa72af7d65c3d5199b3d57bfa2b6c1268306b2.tar.gz bcm5719-llvm-3baa72af7d65c3d5199b3d57bfa2b6c1268306b2.zip |
ThinLTOBitcodeWriter: Do not follow operand edges of type GlobalValue when looking for virtual functions.
Such edges may otherwise result in infinite recursion if a pointer to a vtable
is reachable from the vtable itself. This can happen in practice if a TU
defines the ABI types used to implement RTTI, and is itself compiled with RTTI.
Fixes PR32121.
llvm-svn: 296839
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp b/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp index d6fccb03fec..ac62496e0fe 100644 --- a/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp +++ b/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp @@ -241,6 +241,8 @@ void filterModule( void forEachVirtualFunction(Constant *C, function_ref<void(Function *)> Fn) { if (auto *F = dyn_cast<Function>(C)) return Fn(F); + if (isa<GlobalValue>(C)) + return; for (Value *Op : C->operands()) forEachVirtualFunction(cast<Constant>(Op), Fn); } |