[PATCH] D26840: [ThinLTO] Fix crash when importing an opaque type

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 18 09:42:34 PST 2016


tejohnson added a comment.

In https://reviews.llvm.org/D26840#599984, @mehdi_amini wrote:

> The thing that makes me worried is that this only about the initial types: I wonder if you couldn't start with an empty module, and then import an opaque type, and only then import the definition for this type. I'll try to forge an example.
>
> Also there are calls to addOpaque() during the import, what you suggest seems that some cleanup would be needed.


I thought the issue here was for the dest module, which isn't being imported, and is why the constructor is walking its types to initialize the DstStructTypesSet. The other call to addOpaque is when the source type is opaque, which is the importing case. switchToNonOpaque seems to handle the other case you mention (have an opaque type in dest module, then import a def).


https://reviews.llvm.org/D26840





More information about the llvm-commits mailing list