projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
32ca865
)
void* is represented as pointer to empty struct {}.
author
Torok Edwin
<edwintorok@gmail.com>
Sat, 24 Jan 2009 11:30:49 +0000
(11:30 +0000)
committer
Torok Edwin
<edwintorok@gmail.com>
Sat, 24 Jan 2009 11:30:49 +0000
(11:30 +0000)
Thus we need to check whether the struct is empty before trying to index into
it. This fixes PR3381.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62918
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/InstructionCombining.cpp
b/lib/Transforms/Scalar/InstructionCombining.cpp
index dd55d65e1638de07b9b7ba4a8534859922e00009..aed086709327298440cedb8568ad65ba30e47564 100644
(file)
--- a/
lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/
lib/Transforms/Scalar/InstructionCombining.cpp
@@
-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)) {