mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-13 07:00:59 +00:00
If SI->size() is 0, we are not allowed to dereference ->begin().
This fixed PR3078. llvm-svn: 59416
This commit is contained in:
parent
66bb641598
commit
f67e9bb406
@ -565,9 +565,11 @@ Function *ArgPromotion::DoPromotion(Function *F,
|
||||
// Add a parameter to the function for each element passed in.
|
||||
for (ScalarizeTable::iterator SI = ArgIndices.begin(),
|
||||
E = ArgIndices.end(); SI != E; ++SI) {
|
||||
unsigned num = SI->size();
|
||||
// not allowed to dereference ->begin() if size() is 0
|
||||
Params.push_back(GetElementPtrInst::getIndexedType(I->getType(),
|
||||
&*SI->begin(),
|
||||
SI->size()));
|
||||
num ? &*SI->begin(): 0,
|
||||
num));
|
||||
assert(Params.back());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user