diff options
| author | Eli Friedman <efriedma@quicinc.com> | 2020-06-24 15:54:21 -0700 |
|---|---|---|
| committer | Eli Friedman <efriedma@quicinc.com> | 2020-06-30 12:37:53 -0700 |
| commit | 15440191b57237eafb18600ac653b9a0023db391 (patch) | |
| tree | 56d33b57ff84da3653e156c67c8030a2512cd31f /llvm/lib/Bitcode/Reader/ValueList.cpp | |
| parent | 1ccc49924aeb7bb5fbd2eb956243d16db3a02b08 (diff) | |
[IR] Delete llvm::Constants using the correct type.
In most cases, this doesn't have much impact: the destructors just call
the base class destructor anyway. A few subclasses of ConstantExpr
actually store non-trivial data, though. Make sure we clean up
appropriately.
This is sort of ugly, but I don't see a good alternative given the
constraints.
Issue found by asan buildbots running the testcase for D80330.
Differential Revision: https://reviews.llvm.org/D82509
Diffstat (limited to 'llvm/lib/Bitcode/Reader/ValueList.cpp')
| -rw-r--r-- | llvm/lib/Bitcode/Reader/ValueList.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/ValueList.cpp b/llvm/lib/Bitcode/Reader/ValueList.cpp index 431995fd40ac..63a206eeb022 100644 --- a/llvm/lib/Bitcode/Reader/ValueList.cpp +++ b/llvm/lib/Bitcode/Reader/ValueList.cpp @@ -220,6 +220,6 @@ void BitcodeReaderValueList::resolveConstantForwardRefs() { // Update all ValueHandles, they should be the only users at this point. Placeholder->replaceAllUsesWith(RealVal); - Placeholder->deleteValue(); + delete cast<ConstantPlaceHolder>(Placeholder); } } |
