Add a missing check which cause an invalid .td file to crash tblgen
authorChris Lattner <sabre@nondot.org>
Sat, 25 Mar 2006 22:12:44 +0000 (22:12 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 25 Mar 2006 22:12:44 +0000 (22:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27126 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/DAGISelEmitter.cpp

index 81a45e1d85e0bd1861ef34e52e3d55f6e8dcda46..e9d5c421423d6b3141f3f30e65e0729ee5f37c28 100644 (file)
@@ -1342,6 +1342,9 @@ void DAGISelEmitter::ParseInstructions() {
       
       // Check that it exists in InstResults.
       TreePatternNode *RNode = InstResults[OpName];
+      if (RNode == 0)
+        I->error("Operand $" + OpName + " does not exist in operand list!");
+        
       if (i == 0)
         Res0Node = RNode;
       Record *R = dynamic_cast<DefInit*>(RNode->getLeafValue())->getDef();