commit | 8e36a5c960e07555d80fb98d71c692c20f3ea6c4 | [log] [tgz] |
---|---|---|
author | Evan Cheng <evan.cheng@apple.com> | Mon Mar 29 21:27:30 2010 +0000 |
committer | Evan Cheng <evan.cheng@apple.com> | Mon Mar 29 21:27:30 2010 +0000 |
tree | a4c70e9af0e9c469f84ef71fc3e0de99d67cb60a | |
parent | 0ea86bc411748f10b913f42ef3a71b46ace7ceb2 [diff] [blame] |
Fix PR4975. Avoid referencing empty vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99840 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index faefe29..7a0daf6 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -6051,8 +6051,10 @@ } 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