mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-31 07:43:37 +00:00
Avoid a dangling pointer dereference, PassManager::add can delete the Pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96576 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b49985a849
commit
3460f221cd
@ -475,10 +475,11 @@ int main(int argc, char **argv) {
|
||||
errs() << argv[0] << ": cannot create pass: "
|
||||
<< PassInf->getPassName() << "\n";
|
||||
if (P) {
|
||||
PassKind Kind = P->getPassKind();
|
||||
addPass(Passes, P);
|
||||
|
||||
if (AnalyzeOnly) {
|
||||
switch (P->getPassKind()) {
|
||||
switch (Kind) {
|
||||
case PT_BasicBlock:
|
||||
Passes.add(new BasicBlockPassPrinter(PassInf));
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user