Add more thorough error checking for NULL register classes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46605 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
index 37beff9..c9fc812 100644
--- a/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/ScheduleDAG.cpp
@@ -597,10 +597,11 @@
// Grab the destination register
const TargetRegisterClass *DRC = 0;
DRC = RegInfo.getRegClass(VRBase);
- assert(SRC == DRC &&
+ assert(SRC && DRC && SRC == DRC &&
"Source subregister and destination must have the same class");
} else {
// Create the reg
+ assert(SRC && "Couldn't find source register class");
VRBase = RegInfo.createVirtualRegister(SRC);
}