mirror of
https://github.com/opnsense/src.git
synced 2026-06-04 22:32:43 -04:00
Merge commit eb8f379567e8 from llvm-project (by Florian Hahn):
[DSE] Remove malloc from EarliestEscapeInfo before removing. (#84157)
Not removing the malloc from earliest escape info leaves stale entries
in the cache.
Fixes https://github.com/llvm/llvm-project/issues/84051.
PR: https://github.com/llvm/llvm-project/pull/84157
This fixes a crash in clang (usually a bus error, but can also be
another memory error) when compiling the science/siconos port.
PR: 278174
Reported by: yuri
MFC after: 3 days
(cherry picked from commit aaabed1dea)
This commit is contained in:
parent
2bfda18ff7
commit
928ea8066d
1 changed files with 2 additions and 2 deletions
|
|
@ -1893,6 +1893,7 @@ struct DSEState {
|
|||
Malloc->getArgOperand(0), IRB, TLI);
|
||||
if (!Calloc)
|
||||
return false;
|
||||
|
||||
MemorySSAUpdater Updater(&MSSA);
|
||||
auto *LastDef =
|
||||
cast<MemoryDef>(Updater.getMemorySSA()->getMemoryAccess(Malloc));
|
||||
|
|
@ -1901,9 +1902,8 @@ struct DSEState {
|
|||
LastDef);
|
||||
auto *NewAccessMD = cast<MemoryDef>(NewAccess);
|
||||
Updater.insertDef(NewAccessMD, /*RenameUses=*/true);
|
||||
Updater.removeMemoryAccess(Malloc);
|
||||
Malloc->replaceAllUsesWith(Calloc);
|
||||
Malloc->eraseFromParent();
|
||||
deleteDeadInstruction(Malloc);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue