mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 19:29:31 +00:00
Fix PR485, instead of emitting zero sized arrays, emit arrays of size 1.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18974 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
00e8930206
commit
3e3b6f7a46
@ -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) + "]");
|
||||
}
|
||||
|
@ -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
Block a user