aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2012-12-13 01:34:32 +0000
committerEvan Cheng <evan.cheng@apple.com>2012-12-13 01:34:32 +0000
commit9a65a01eeb97cdc10ca6b97ade3f9f8aba11fa9f (patch)
treed376ded4c446a84b0834cee60526d031460ffb5e /lib
parentb573539c6b47d020ade2e41c0ff3afcd00f294f4 (diff)
downloadexternal_llvm-9a65a01eeb97cdc10ca6b97ade3f9f8aba11fa9f.zip
external_llvm-9a65a01eeb97cdc10ca6b97ade3f9f8aba11fa9f.tar.gz
external_llvm-9a65a01eeb97cdc10ca6b97ade3f9f8aba11fa9f.tar.bz2
Fix a bug in DAGCombiner::MatchBSwapHWord. Make sure the node has operands before referencing them. rdar://12868039
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170078 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/SelectionDAG/DAGCombiner.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 893cf20..7c54d17 100644
--- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -2984,7 +2984,8 @@ SDValue DAGCombiner::MatchBSwapHWord(SDNode *N, SDValue N0, SDValue N1) {
SDValue N00 = N0.getOperand(0);
SDValue N01 = N0.getOperand(1);
- if (N1.getOpcode() == ISD::OR) {
+ if (N1.getOpcode() == ISD::OR &&
+ N00.getNumOperands() == 2 && N01.getNumOperands() == 2) {
// (or (or (and), (and)), (or (and), (and)))
SDValue N000 = N00.getOperand(0);
if (!isBSwapHWordElement(N000, Parts))