Avoid assertion in MSVC 2013 debug builds.
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 2 Mar 2015 16:42:56 +0000 (16:42 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 2 Mar 2015 16:42:56 +0000 (16:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230972 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index dcb2ab0a333d0aa8bcb7dc4d3ac7abf3095c8e60..00dc717e1e472548be6d11945f1b5a59030df6d6 100644 (file)
@@ -5419,7 +5419,7 @@ UpdateNodeOperands(SDNode *N, ArrayRef<SDValue> Ops) {
          "Update with wrong number of operands");
 
   // If no operands changed just return the input node.
-  if (std::equal(Ops.begin(), Ops.end(), N->op_begin()))
+  if (!Ops.empty() && std::equal(Ops.begin(), Ops.end(), N->op_begin()))
     return N;
 
   // See if the modified node already exists.