From af0682b887a7601b00e78aeabbc4b1f95711c761 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Thu, 27 Mar 2014 02:49:18 +0000 Subject: [PATCH] Assert that MCSymbolizer is constructed with a valid (or at least non-null) RelocationInfo argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204893 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCSymbolizer.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/llvm/MC/MCSymbolizer.h b/include/llvm/MC/MCSymbolizer.h index 95d29ec673a..64c2b38bf6f 100644 --- a/include/llvm/MC/MCSymbolizer.h +++ b/include/llvm/MC/MCSymbolizer.h @@ -47,7 +47,10 @@ protected: public: /// \brief Construct an MCSymbolizer, taking ownership of \p RelInfo. MCSymbolizer(MCContext &Ctx, std::unique_ptr RelInfo) - : Ctx(Ctx), RelInfo(std::move(RelInfo)) {} + : Ctx(Ctx), RelInfo(std::move(RelInfo)) { + assert(this->RelInfo != nullptr && + "Cannot construct MCSymbolizer without relocation info."); + } virtual ~MCSymbolizer();