projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
b984970
)
Fix test/Regression/CFrontend/2003-11-01-EmptyStructCrash.c
author
Chris Lattner
<sabre@nondot.org>
Mon, 22 Nov 2004 19:15:27 +0000
(19:15 +0000)
committer
Chris Lattner
<sabre@nondot.org>
Mon, 22 Nov 2004 19:15:27 +0000
(19:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18115
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/VMCore/ConstantFold.cpp
patch
|
blob
|
history
diff --git
a/lib/VMCore/ConstantFold.cpp
b/lib/VMCore/ConstantFold.cpp
index 02b7fe2975a981e596c4d0e65cee1fcc7b39fea4..e2080642ca620186084321d6abc907276da2893f 100644
(file)
--- a/
lib/VMCore/ConstantFold.cpp
+++ b/
lib/VMCore/ConstantFold.cpp
@@
-574,6
+574,7
@@
Constant *llvm::ConstantFoldCastInstruction(const Constant *V,
const Type *ElTy = PTy->getElementType();
while (ElTy != DPTy->getElementType()) {
if (const StructType *STy = dyn_cast<StructType>(ElTy)) {
+ if (STy->getNumElements() == 0) break;
ElTy = STy->getElementType(0);
IdxList.push_back(Constant::getNullValue(Type::UIntTy));
} else if (const SequentialType *STy = dyn_cast<SequentialType>(ElTy)) {