From 0ab72a9ef2031e3aeb4f8ea7278e82ea5acb4f4d Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Mon, 9 Jan 2012 16:45:35 +0400 Subject: [PATCH] =?UTF-8?q?Fixed=20#55=20=E2=80=94=20Illegal=20instruction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't artificially set zero-length arrays to dimension 1. --- ir/irtype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ir/irtype.cpp b/ir/irtype.cpp index 266bcc34..ef9aa02a 100644 --- a/ir/irtype.cpp +++ b/ir/irtype.cpp @@ -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); } //////////////////////////////////////////////////////////////////////////////