forked from OSchip/llvm-project
Fix PR485, instead of emitting zero sized arrays, emit arrays of size 1.
llvm-svn: 18974
This commit is contained in:
parent
e56242780c
commit
298a7f8d8b
|
@ -338,6 +338,7 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty,
|
|||
case Type::ArrayTyID: {
|
||||
const ArrayType *ATy = cast<ArrayType>(Ty);
|
||||
unsigned NumElements = ATy->getNumElements();
|
||||
if (NumElements == 0) NumElements = 1;
|
||||
return printType(Out, ATy->getElementType(),
|
||||
NameSoFar + "[" + utostr(NumElements) + "]");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue