From 66b0cebf7f736d888aae6c9aeb8c144049c24528 Mon Sep 17 00:00:00 2001 From: Yaron Keren Date: Sun, 14 Sep 2014 20:36:28 +0000 Subject: 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. llvm-svn: 217737 --- llvm/lib/CodeGen/DwarfEHPrepare.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/DwarfEHPrepare.cpp b/llvm/lib/CodeGen/DwarfEHPrepare.cpp index 705e5d657c3..75b74d9a6c3 100644 --- a/llvm/lib/CodeGen/DwarfEHPrepare.cpp +++ b/llvm/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 { -- cgit v1.2.3