summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2010-03-29 21:27:30 +0000
committerEvan Cheng <evan.cheng@apple.com>2010-03-29 21:27:30 +0000
commit742db6874a10b7bd3eaade2e865ef12ed357e74e (patch)
treef9ec063bcfad928bf9f7e2d6fba217596bffc5f4 /llvm/lib/CodeGen
parentb355db7877176696fa7e57269b44e26a312fc623 (diff)
downloadbcm5719-llvm-742db6874a10b7bd3eaade2e865ef12ed357e74e.tar.gz
bcm5719-llvm-742db6874a10b7bd3eaade2e865ef12ed357e74e.zip
Fix PR4975. Avoid referencing empty vector.
llvm-svn: 99840
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index faefe2932ec..7a0daf69c84 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -6051,8 +6051,10 @@ void SelectionDAGISel::LowerArguments(BasicBlock *LLVMBB) {
}
if (!I->use_empty()) {
- SDValue Res = DAG.getMergeValues(&ArgValues[0], NumValues,
- SDB->getCurDebugLoc());
+ SDValue Res;
+ if (!ArgValues.empty())
+ Res = DAG.getMergeValues(&ArgValues[0], NumValues,
+ SDB->getCurDebugLoc());
SDB->setValue(I, Res);
// If this argument is live outside of the entry block, insert a copy from
OpenPOWER on IntegriCloud