Add a missing assertion, the null register has no register units.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 21 Dec 2012 18:38:09 +0000 (18:38 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 21 Dec 2012 18:38:09 +0000 (18:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170916 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCRegisterInfo.h

index 1fe870ed14286e6b4b9800f4044361955ad8016b..f5b4dddc5198a361df9d98a4ef9eb456cffebc0f 100644 (file)
@@ -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;