[all-commits] [llvm/llvm-project] cff192: [clang-include-fixer] Fix incorrect ranking becaus...
Danila Kutenin via All-commits
all-commits at lists.llvm.org
Mon Dec 20 07:04:43 PST 2021
Author: Danila Kutenin <kutdanila at yandex.ru>
Date: 2021-12-20 (Mon, 20 Dec 2021)
[clang-include-fixer] Fix incorrect ranking because of dangling references
SymbolAndSignals stores SymbolInfo which stores two std::strings. Then
the values are stored in a llvm::DenseMap<llvm::StringRef, double>. When
the sorting is happening, SymbolAndSignals are swapped and thus because
of small string optimization some strings may become invalid. This
results in incorrect ranking.
This was detected when running new std::sort algorithm against llvm
toolchain. This could have been prevented with running llvm::sort and
EXPENSIVE_CHECKS. Unfortunately, no sanitizer yelled.
I don't have commit rights, kutdanila at yandex.ru Danila Kutenin
Reviewed By: bkramer
Differential Revision: https://reviews.llvm.org/D116037
More information about the All-commits