mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Fix PR14034, an infloop / heap corruption / crash bug in the new SROA.
Thanks to Benjamin for the raw test case. This one took about 50 times longer to reduce than to fix. =/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165476 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1786,6 +1786,8 @@ static Value *getNaturalGEPWithType(IRBuilder<> &IRB, const DataLayout &TD,
|
||||
ElementTy = SeqTy->getElementType();
|
||||
Indices.push_back(IRB.getInt(APInt(TD.getPointerSizeInBits(), 0)));
|
||||
} else if (StructType *STy = dyn_cast<StructType>(ElementTy)) {
|
||||
if (STy->element_begin() == STy->element_end())
|
||||
break; // Nothing left to descend into.
|
||||
ElementTy = *STy->element_begin();
|
||||
Indices.push_back(IRB.getInt32(0));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user