In DwarfEHPrepare, after all passes are run, RewindFunction may be a dangling
authorYaron Keren <yaron.keren@gmail.com>
Sun, 14 Sep 2014 20:36:28 +0000 (20:36 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Sun, 14 Sep 2014 20:36:28 +0000 (20:36 +0000)
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

lib/CodeGen/DwarfEHPrepare.cpp

index 705e5d657c39da1c81cfbecc7ca86a8c216ea579..75b74d9a6c33243a79369f73147750e89e7e1bfb 100644 (file)
@@ -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 {