[PATCH] D47969: [Verifier] Check that ValueAsMetadata belongs to the module

Roman Tereshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 12:58:01 PDT 2018


rtereshin added a comment.

In https://reviews.llvm.org/D47969#1128771, @vlad.tsyrklevich wrote:

> Actually, I'm not sure that mail is necessary. After looking at ODR type uniquing a bit I think the correct behavior is to wrap your check in `if (!M.getContext().isODRUniquingDebugTypes())` since I believe we expect ODR uniquing to be able to create cross-module references but we should otherwise not see them. Adding @tejohnson @pcc to take a look as well.


Metadata are shared between modules by design, but having a `Value` (in this case, a global constant) that belongs to one module and is reachable from another in the same time is odd. Is that really something we explicitly support? Will we get a dangling pointer reachable from an alive module if the owning module gets deallocated?


Repository:
  rL LLVM

https://reviews.llvm.org/D47969





More information about the llvm-commits mailing list