diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-01-03 22:42:33 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2018-01-03 22:42:33 +0000 |
commit | ec0a2fb7037aab3eca8eacdfe85692d3c140a40f (patch) | |
tree | 7d0831d213cec6f601a80cc89a52000ffb3078ee /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 31abb45803d272b3fd211253f571047256ab2f19 (diff) | |
download | bcm5719-llvm-ec0a2fb7037aab3eca8eacdfe85692d3c140a40f.tar.gz bcm5719-llvm-ec0a2fb7037aab3eca8eacdfe85692d3c140a40f.zip |
[DAGCombine] Handle out of range EXTRACT_VECTOR_ELT indices
Handle this in DAGCombiner::visitEXTRACT_VECTOR_ELT the same as we already do in SelectionDAG::getNode and use APInt instead of getZExtValue.
This should also fix oss-fuzz #4910
llvm-svn: 321767
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 4c8b63d2f23..7e99863b1ee 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -4453,7 +4453,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, return getUNDEF(VT); // EXTRACT_VECTOR_ELT of out-of-bounds element is an UNDEF - if (N2C && N2C->getZExtValue() >= N1.getValueType().getVectorNumElements()) + if (N2C && N2C->getAPIntValue().uge(N1.getValueType().getVectorNumElements())) return getUNDEF(VT); // EXTRACT_VECTOR_ELT of CONCAT_VECTORS is often formed while lowering is |