mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-23 20:15:35 +00:00
void* is represented as pointer to empty struct {}.
Thus we need to check whether the struct is empty before trying to index into it. This fixes PR3381. llvm-svn: 62918
This commit is contained in:
parent
78b6a961bb
commit
726354d4ce
@ -11170,6 +11170,8 @@ static Instruction *InstCombineStoreToCast(InstCombiner &IC, StoreInst &SI) {
|
||||
|
||||
while (1) {
|
||||
if (const StructType *STy = dyn_cast<StructType>(SrcPTy)) {
|
||||
if (!STy->getNumElements()) /* Void is represented as {} */
|
||||
break;
|
||||
NewGEPIndices.push_back(Zero);
|
||||
SrcPTy = STy->getElementType(0);
|
||||
} else if (const ArrayType *ATy = dyn_cast<ArrayType>(SrcPTy)) {
|
||||
|
Loading…
Reference in New Issue
Block a user