]> granicus.if.org Git - llvm/commit
IRMover: Avoid accidentally mapping types from the destination module (PR30799)
authorHans Wennborg <hans@hanshq.net>
Fri, 18 Nov 2016 17:33:05 +0000 (17:33 +0000)
committerHans Wennborg <hans@hanshq.net>
Fri, 18 Nov 2016 17:33:05 +0000 (17:33 +0000)
commit3e367e61a752c3e4a30f9dbaebe055ff28be4cf8
tree8aa0aada0a2b2fc2d087c38126821ba75c12cf41
parented72617844d995db27f4d0b1a08f5bfd39f9976a
IRMover: Avoid accidentally mapping types from the destination module (PR30799)

During Module linking, it's possible for SrcM->getIdentifiedStructTypes();
to return types that are actually defined in the destination module
(DstM). Depending on how the bitcode file was read,
getIdentifiedStructTypes() might do a walk over all values, including
metadata nodes, looking for types. In my case, a debug info metadata
node was shared between the two modules, and it referred to a type
defined in the destination module (see test case).

Differential Revision: https://reviews.llvm.org/D26212

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287353 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Linker/IRMover.cpp
test/LTO/X86/Inputs/type-mapping-src.ll [new file with mode: 0644]
test/LTO/X86/type-mapping-bug.ll [new file with mode: 0644]