fix a valgrind error on copy-constructor-synthesis.cpp, which is caused when
[oota-llvm.git] / lib / CodeGen / SelectionDAG / InstrEmitter.cpp
index e86a18dc2b4b83db221b7990d37927e88e64c07b..7b660f530f73f881b0dae9b12c83766dce3c89ea 100644 (file)
@@ -617,9 +617,10 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned,
     // specific inserter which may returns a new basic block.
     MBB = TLI->EmitInstrWithCustomInserter(MI, MBB, EM);
     InsertPos = MBB->end();
-  } else {
-    MBB->insert(InsertPos, MI);
+    return;
   }
+  
+  MBB->insert(InsertPos, MI);
 
   // Additional results must be an physical register def.
   if (HasPhysRegOuts) {