aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-01-05 01:39:17 +0000
committerChris Lattner <sabre@nondot.org>2008-01-05 01:39:17 +0000
commit7ebe08504ba075c4a83df7ecec86d5e032b20781 (patch)
tree54fec129fe5809a42c76dfa1cfb759c94ea318c9 /lib
parent1bcd6ddb70e165d81e7e280c1afc333b95193f11 (diff)
downloadexternal_llvm-7ebe08504ba075c4a83df7ecec86d5e032b20781.zip
external_llvm-7ebe08504ba075c4a83df7ecec86d5e032b20781.tar.gz
external_llvm-7ebe08504ba075c4a83df7ecec86d5e032b20781.tar.bz2
fix a common crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/MachineSink.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineSink.cpp b/lib/CodeGen/MachineSink.cpp
index 0665e87..dff60f6 100644
--- a/lib/CodeGen/MachineSink.cpp
+++ b/lib/CodeGen/MachineSink.cpp
@@ -180,6 +180,10 @@ bool MachineSinking::SinkInstruction(MachineInstr *MI) {
}
}
+ // If there are no outputs, it must have side-effects.
+ if (SuccToSinkTo == 0)
+ return false;
+
// FIXME: Check that the instr doesn't have side effects etc.
DEBUG(cerr << "Sink instr " << *MI);