Skip to content

Commit

Permalink
In DwarfEHPrepare, after all passes are run, RewindFunction may be a …
Browse files Browse the repository at this point in the history
…dangling

pointer to a dead function. To make sure it's valid, doFinalization nullptrs
RewindFunction just like the constructor and so it will be found on next run.

llvm-svn: 217737
  • Loading branch information
yrnkrn committed Sep 14, 2014
1 parent f620a57 commit 66b0ceb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions llvm/lib/CodeGen/DwarfEHPrepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ namespace {

bool runOnFunction(Function &Fn) override;

bool doFinalization(Module &M) override {
RewindFunction = nullptr;
return false;
}

void getAnalysisUsage(AnalysisUsage &AU) const override { }

const char *getPassName() const override {
Expand Down

0 comments on commit 66b0ceb

Please sign in to comment.