When the reference 'e' to stack top is popped, the call to erase(e)
reads from this now invalid reference. ASAN catches this as a container
overflow. We fix this by taking a copy of the stack top instead.

Note that this was similarly fixed in upstream LLVM as well:
9987d98370
This commit is contained in:
Antonio Maiorano 2023-09-14 10:04:26 -04:00 коммит произвёл GitHub
Родитель 3266a87f9a
Коммит c8375d5a3d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -460,7 +460,7 @@ void LazyValueInfoCache::eraseBlock(BasicBlock *BB) {
void LazyValueInfoCache::solve() {
while (!BlockValueStack.empty()) {
std::pair<BasicBlock*, Value*> &e = BlockValueStack.top();
std::pair<BasicBlock*, Value*> e = BlockValueStack.top();
assert(BlockValueSet.count(e) && "Stack value should be in BlockValueSet!");
if (solveBlockValue(e.second, e.first)) {