aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-12-21 18:38:09 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-12-21 18:38:09 +0000
commit70fe6ecb6d0c3b556f2c4e3c1e5013da821beded (patch)
tree021a2f746be057798386ddfb9e84c857b58f0aac
parent4716cf49814e918d3d3fcc1dbdbc69f8c2197f3f (diff)
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
-rw-r--r--include/llvm/MC/MCRegisterInfo.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/llvm/MC/MCRegisterInfo.h b/include/llvm/MC/MCRegisterInfo.h
index 1fe870ed14..f5b4dddc51 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;