From: Yaron Keren Date: Sun, 14 Sep 2014 20:36:28 +0000 (+0000) Subject: In DwarfEHPrepare, after all passes are run, RewindFunction may be a dangling X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e1c77ca37a3c27064262bfdc22d0f3e62a4b789f;p=oota-llvm.git In DwarfEHPrepare, after all passes are run, RewindFunction may be a 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217737 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/DwarfEHPrepare.cpp b/lib/CodeGen/DwarfEHPrepare.cpp index 705e5d657c3..75b74d9a6c3 100644 --- a/lib/CodeGen/DwarfEHPrepare.cpp +++ b/lib/CodeGen/DwarfEHPrepare.cpp @@ -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 {