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

Vlad Tsyrklevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 11 13:31:00 PDT 2018


vlad.tsyrklevich added a comment.

> 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?

I agree that it's surprising, Teresa/Dexon/Mehdi have worked on DI ODR uniquing before so they're in a better place to comment on whether it's expected.

>   Will we get a dangling pointer reachable from an alive module if the owning module gets deallocated?

Value::~Value() calls out ValueAsMetadata::handleDeletion() so it seems like it would not leave a stale reference though I haven't tested this (and I'm also not sure if the code that handles DITemplateValueParameters would handle null Metadata entries well.)


Repository:
  rL LLVM

https://reviews.llvm.org/D47969





More information about the llvm-commits mailing list