OSDN Git Service

Hexagon: Avoid dereferencing end() in HexagonCopyToCombine::findPairable
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 11 Aug 2016 16:40:03 +0000 (16:40 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 11 Aug 2016 16:40:03 +0000 (16:40 +0000)
commitaba9f58b23e0c6d647f1e0d103ca8cb7193157ca
treeb1066ee990756496a67546d1417bd7d61ec41605
parent9bcebab62b034d48bbf944179cced1a2f07ffbf6
Hexagon: Avoid dereferencing end() in HexagonCopyToCombine::findPairable

Check for end() before skipping through debug values.  This avoids
dereferencing end() when the instruction is the final one in the basic
block.  (It still assumes that a debug value will not be the final
instruction in the basic block.  No tests seemed to violate that.)

Many Hexagon tests trigger this, but they happen to magically pass right
now.  I found this because WIP patches for PR26753 convert them into
crashes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278355 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Hexagon/HexagonCopyToCombine.cpp