[llvm] r299361 - [DAGCombiner] Check limits before accessing array element (PR32502)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 3 08:27:50 PDT 2017
Author: rksimon
Date: Mon Apr 3 10:27:49 2017
New Revision: 299361
URL: http://llvm.org/viewvc/llvm-project?rev=299361&view=rev
Log:
[DAGCombiner] Check limits before accessing array element (PR32502)
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=299361&r1=299360&r2=299361&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Mon Apr 3 10:27:49 2017
@@ -1661,7 +1661,7 @@ SDValue DAGCombiner::visitTokenFactor(SD
Changed = true;
DidPruneOps = true;
unsigned OrigOpNumber = 0;
- while (Ops[OrigOpNumber].getNode() != Op && OrigOpNumber < Ops.size())
+ while (OrigOpNumber < Ops.size() && Ops[OrigOpNumber].getNode() != Op)
OrigOpNumber++;
assert((OrigOpNumber != Ops.size()) &&
"expected to find TokenFactor Operand");
More information about the llvm-commits
mailing list