Add more thorough error checking for NULL register classes.
authorChristopher Lamb <christopher.lamb@gmail.com>
Thu, 31 Jan 2008 07:09:08 +0000 (07:09 +0000)
committerChristopher Lamb <christopher.lamb@gmail.com>
Thu, 31 Jan 2008 07:09:08 +0000 (07:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46605 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/ScheduleDAG.cpp

index 37beff96191c27c37b4bcdc944e13ff61a0a6770..c9fc812259a32cba63db0321bd501ba74202ed09 100644 (file)
@@ -597,10 +597,11 @@ void ScheduleDAG::EmitSubregNode(SDNode *Node,
       // 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);
     }