OSDN Git Service

Avoid triggering an assertion failure when an instruction pattern
authorDan Gohman <gohman@apple.com>
Fri, 16 Jan 2009 21:30:55 +0000 (21:30 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 16 Jan 2009 21:30:55 +0000 (21:30 +0000)
is a leaf node. Patch by Brandner!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62361 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/DAGISelEmitter.cpp

index ace1d76..9f028ed 100644 (file)
@@ -925,7 +925,8 @@ public:
       TreePatternNode *InstPatNode =
         isRoot ? (InstPat ? InstPat->getTree(0) : Pattern)
                : (InstPat ? InstPat->getTree(0) : NULL);
-      if (InstPatNode && InstPatNode->getOperator()->getName() == "set") {
+      if (InstPatNode && !InstPatNode->isLeaf() &&
+          InstPatNode->getOperator()->getName() == "set") {
         InstPatNode = InstPatNode->getChild(InstPatNode->getNumChildren()-1);
       }
       bool IsVariadic = isRoot && II.isVariadic;