[lld] [lld] check cache before real_path in loadDylib (PR #140791)

Richard Howell via llvm-commits llvm-commits at lists.llvm.org
Thu May 22 06:43:36 PDT 2025


================
@@ -253,6 +265,7 @@ DylibFile *macho::loadDylib(MemoryBufferRef mbref, DylibFile *umbrella,
     }
     file =
         make<DylibFile>(**result, umbrella, isBundleLoader, explicitlyLinked);
+    realfile = file;
----------------
rmaz wrote:

> Then what happens on this line? It does a load and a store to the same address? 
Thats what I thought would happen, yes.

> Also, if we set file later in the future, how can we make sure to not forget to also set realfile? Is there a better way of doing this?
What would you suggest? Ultimately we have 2 cache pointers, that may or may not point to the same thing, and we need to update them. 


https://github.com/llvm/llvm-project/pull/140791


More information about the llvm-commits mailing list