diff options
| author | Chijun Sima <simachijun@gmail.com> | 2018-08-15 13:56:21 +0000 |
|---|---|---|
| committer | Chijun Sima <simachijun@gmail.com> | 2018-08-15 13:56:21 +0000 |
| commit | e8263f33d93c811bfc26c7d2d2eaaee4196d06be (patch) | |
| tree | ce53d2c38661e52876d2c020a90cff9fe0f2617f /clang-tools-extra/clang-doc/BitcodeReader.cpp | |
| parent | 942e8ed19d519fa983d1c06acc9390db800c1761 (diff) | |
[SimplifyCFG] Remove pointer from SmallPtrSet before deletion
Summary:
Previously, `eraseFromParent()` calls `delete` which invalidates the value of the pointer. Copying the value of the pointer later is undefined behavior in C++11 and implementation-defined (which may cause a segfault on implementations having strict pointer safety) in C++14.
This patch removes the BasicBlock pointer from related SmallPtrSet before `delete` invalidates it in the SimplifyCFG pass.
Reviewers: kuhar, dmgreen, davide, trentxintong
Reviewed By: kuhar, dmgreen
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D50717
llvm-svn: 339773
Diffstat (limited to 'clang-tools-extra/clang-doc/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions
