diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-25 18:49:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-25 18:49:10 +0000 |
commit | 7bf198fd607b356e767e0577cac81c3491c4bc90 (patch) | |
tree | b1472380ed992d0b28b97467b9e63e0ae7b9fb12 /lib/CodeGen | |
parent | fd59f4cd3d099bf737a01eb75240fbf8e51cab62 (diff) |
fix a valgrind error on copy-constructor-synthesis.cpp, which is caused when
the custom insertion hook deletes the instruction, then we try to set dead
flags on it. Neither the code that I added nor the code that was there
before was safe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99538 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp index e86a18dc2b..7b660f530f 100644 --- a/lib/CodeGen/SelectionDAG/InstrEmitter.cpp +++ b/lib/CodeGen/SelectionDAG/InstrEmitter.cpp @@ -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) { |