diff options
author | Amara Emerson <aemerson@apple.com> | 2018-01-04 18:38:45 +0000 |
---|---|---|
committer | Amara Emerson <aemerson@apple.com> | 2018-01-04 18:38:45 +0000 |
commit | 8a100dd2a60c714a7d8b6a3620f800c1056fb86d (patch) | |
tree | 7be5bb1e3d2ac1369ec8fde62c6a8c915985fcfd /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | d30bea4559c2883766c15777eba0a53740a28598 (diff) | |
download | bcm5719-llvm-8a100dd2a60c714a7d8b6a3620f800c1056fb86d.tar.gz bcm5719-llvm-8a100dd2a60c714a7d8b6a3620f800c1056fb86d.zip |
[DAGCombine] Ensure SDNode use iterator is incremented properly.
Fixes an ASAN bug found by oss-fuzz.
llvm-svn: 321813
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 2b44e4fa93c..25ae71c57cb 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -2816,8 +2816,8 @@ SDValue DAGCombiner::useDivRem(SDNode *Node) { SDValue Op1 = Node->getOperand(1); SDValue combined; for (SDNode::use_iterator UI = Op0.getNode()->use_begin(), - UE = Op0.getNode()->use_end(); UI != UE;) { - SDNode *User = *UI++; + UE = Op0.getNode()->use_end(); UI != UE; ++UI) { + SDNode *User = *UI; if (User == Node || User->use_empty()) continue; // Convert the other matching node(s), too; |