From a761228d2032f2f2525ed601b761e28395bf6771 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Fri, 18 Mar 2016 22:35:58 +0000 Subject: [PATCH] [sancov] Fix the sancov pass to initialize itself inside its constructor. This should fix the recent crashes on certain architectures. llvm-svn: 263845 --- lib/Transforms/Instrumentation/SanitizerCoverage.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/Instrumentation/SanitizerCoverage.cpp b/lib/Transforms/Instrumentation/SanitizerCoverage.cpp index 5b7bb2fb121..3d27f6baee6 100644 --- a/lib/Transforms/Instrumentation/SanitizerCoverage.cpp +++ b/lib/Transforms/Instrumentation/SanitizerCoverage.cpp @@ -152,7 +152,9 @@ class SanitizerCoverageModule : public ModulePass { public: SanitizerCoverageModule( const SanitizerCoverageOptions &Options = SanitizerCoverageOptions()) - : ModulePass(ID), Options(OverrideFromCL(Options)) {} + : ModulePass(ID), Options(OverrideFromCL(Options)) { + initializeSanitizerCoverageModulePass(*PassRegistry::getPassRegistry()); + } bool runOnModule(Module &M) override; bool runOnFunction(Function &F); static char ID; // Pass identification, replacement for typeid