diff options
author | William Junda Huang <williamjhuang@google.com> | 2023-11-29 16:48:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-29 21:48:55 +0000 |
commit | 68106bd492e294ecf0a7e2829dd9edf6cd72f3ef (patch) | |
tree | 90c8fce3eb140b71928d64d2ffde5426ca8f9342 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | f150ecc32276d3afa96f673ebbd388d99ac1ccca (diff) | |
download | llvm-68106bd492e294ecf0a7e2829dd9edf6cd72f3ef.zip llvm-68106bd492e294ecf0a7e2829dd9edf6cd72f3ef.tar.gz llvm-68106bd492e294ecf0a7e2829dd9edf6cd72f3ef.tar.bz2 |
[Sample Profile Loader] Fix potential invalidated reference (#73181)
There is a potential issue in ProfiledCallGraph where pointers to
ProfiledCallGraphNode are used to construct edges, while
ProfiledCallGraphNode instances are being added to a hash map
ProfiledFunctions simultaneously. If rehash happens, those pointers are
invalidated, resulting in undefined behavior/crash. Previously (before
md5phase2) ProfiledFunctions is a llvm::StringMap, which also have the
same issue theoretically when rehashing but was not observed. This patch
fixes this potential issue by using a backing buffer for
ProrfiledCallGraphNode that does not relocate.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions