Fixed #55 — Illegal instruction

Don't artificially set zero-length arrays to dimension 1.
This commit is contained in:
Alexey Prokhin
2012-01-09 16:45:35 +04:00
parent 9889067420
commit 0ab72a9ef2

View File

@@ -193,7 +193,7 @@ llvm::Type * IrTypeSArray::sarray2llvm(Type * t)
LLType* elemType = DtoType(t->nextOf());
if (elemType == llvm::Type::getVoidTy(llvm::getGlobalContext()))
elemType = llvm::Type::getInt8Ty(llvm::getGlobalContext());
return llvm::ArrayType::get(elemType, dim == 0 ? 1 : dim);
return llvm::ArrayType::get(elemType, dim);
}
//////////////////////////////////////////////////////////////////////////////