From: Jakob Stoklund Olesen Date: Fri, 21 Dec 2012 18:38:09 +0000 (+0000) Subject: Add a missing assertion, the null register has no register units. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=70fe6ecb6d0c3b556f2c4e3c1e5013da821beded;p=oota-llvm.git Add a missing assertion, the null register has no register units. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170916 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/MC/MCRegisterInfo.h b/include/llvm/MC/MCRegisterInfo.h index 1fe870ed142..f5b4dddc519 100644 --- a/include/llvm/MC/MCRegisterInfo.h +++ b/include/llvm/MC/MCRegisterInfo.h @@ -479,6 +479,7 @@ public: /// MCRegUnitIterator - Create an iterator that traverses the register units /// in Reg. MCRegUnitIterator(unsigned Reg, const MCRegisterInfo *MCRI) { + assert(Reg && "Null register has no regunits"); // Decode the RegUnits MCRegisterDesc field. unsigned RU = MCRI->get(Reg).RegUnits; unsigned Scale = RU & 15;