aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorWilliam Huang <williamjhuang@google.com>2023-08-16 00:00:26 +0000
committerWilliam Huang <williamjhuang@google.com>2023-08-16 20:32:15 +0000
commitda2855c0bad09a53c122797ecc18bdd02505e1c0 (patch)
tree8e2f96c09584048c9cdd5faf7932250947f202cf /clang/lib/CodeGen/CodeGenFunction.cpp
parentbc5a023b81ec6ce7213f779e49cfc177a0efd8e9 (diff)
downloadllvm-da2855c0bad09a53c122797ecc18bdd02505e1c0.zip
llvm-da2855c0bad09a53c122797ecc18bdd02505e1c0.tar.gz
llvm-da2855c0bad09a53c122797ecc18bdd02505e1c0.tar.bz2
[SampleProfile] Potential use after move in SampleProfileLoader::promoteMergeNotInlinedContextSamples
SampleProfileLoader::promoteMergeNotInlinedContextSample adds certain uninlined functions to the sample profile map (unordered_map, which is previously read from a profile file). This action may cause the map to be rehashed, invalidating all pointers to FunctionSamples used by many members of SampleProfileLoader, while the existing code did nothing to guard against that. This bug is theoretical since adding a few new functions to a large profile usually won't trigger a rehash, or even if there's a rehash std::unordered_map tries its best to expand its capacity in-place. This bug will trigger if the container type of sample profile map is changed to llvm::DenseMap or other implementation, such as in D147740, for SampleProfReader's performance reason. Reviewed By: wenlei Differential Revision: https://reviews.llvm.org/D157061
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions