[PATCH] D18683: Fix bug with duplicate struct types in Linker

Tim Armstrong via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 31 23:18:05 PDT 2016


timarmstrong created this revision.
timarmstrong added a reviewer: rafael.
timarmstrong added a subscriber: llvm-commits.

This fixes a corner case where two structurally identical struct types
were erroneously merged into one when present in both the source and
destination modules. This could cause assertion failures and verification
failures when constructing IR modules through a combination of IRBuilder
and linking.

The fix is to track all struct types by pointer identity, which allows us to accurately check whether the struct type is present in the destination module. As a corollary, the code is slightly simpler.

http://reviews.llvm.org/D18683

Files:
  include/llvm/Linker/IRMover.h
  lib/Linker/IRMover.cpp
  unittests/Linker/LinkModulesTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18683.52328.patch
Type: text/x-patch
Size: 4926 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160401/4fde2d6f/attachment.bin>


More information about the llvm-commits mailing list