[llvm] [Sample Profile Loader] Fix potential invalidated reference (PR #73181)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 22 17:04:30 PST 2023


WenleiHe wrote:

> Previously (before md5phase2) ProfiledFunctions is a llvm::StringMap, which also have the same issue theoretically when rehashing but was not observed. 

This is again the consequence of you breaking reference stability with the new container. Before your change, there is no issue with StringMap -- it guarantees reference stability and rehash does not cause the underlying StringMapEntryBase to be reallocated. The code works with the assumption of reference stability. 

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


More information about the llvm-commits mailing list